diff options
author | wei <> | 2006-01-13 04:55:22 +0000 |
---|---|---|
committer | wei <> | 2006-01-13 04:55:22 +0000 |
commit | 8da0f8dd4a0347f15df6e71ac2b0f4b3c27e8475 (patch) | |
tree | f4b75568da1fd702bcb3320259bb1642f3cc53b8 /framework/Web/Javascripts/base/ajax.js | |
parent | d202492e4ad31c4127b4b459b300de7cd1976c1b (diff) |
Focus added to client validators
Diffstat (limited to 'framework/Web/Javascripts/base/ajax.js')
-rw-r--r-- | framework/Web/Javascripts/base/ajax.js | 76 |
1 files changed, 3 insertions, 73 deletions
diff --git a/framework/Web/Javascripts/base/ajax.js b/framework/Web/Javascripts/base/ajax.js index ccfb085d..06c3d741 100644 --- a/framework/Web/Javascripts/base/ajax.js +++ b/framework/Web/Javascripts/base/ajax.js @@ -386,86 +386,16 @@ Prado.AJAX.Validate = function(options) if(options.CausesValidation)
{
if(options.ValidatorGroup)
- return Prado.AJAX.ValidateGroup1(options.ValidatorGroup);
+ return Prado.Validation.ValidateValidatorGroup(options.ValidatorGroup);
else if(options.ValidationGroup)
- return Prado.AJAX.ValidateGroup2(options.ValidationGroup);
+ return Prado.Validation.ValidateValidationGroup(options.ValidationGroup);
else
- return Prado.AJAX.ValidateOthers(options.ValidationForm);
+ return Prado.Validation.ValidateNonGroup(options.ValidationForm);
}
else
return true;
};
-/**
- * Validate Validator Groups.
- * @param string ValidatorGroup
- * @return boolean true if valid, false otherwise
- */
-Prado.AJAX.ValidateGroup1 = function(groupId)
-{
- var groups = Prado.Validation.groups;
- var group = null;
- for(var i = 0; i < groups.length; i++)
- {
- if(groups[i].id == groupId)
- {
- group = groups[i];
- Prado.Validation.groups[i].active = true;
- Prado.Validation.CurrentTargetGroup = null;
- Prado.Validation.IsGroupValidation = true;
- }
- else
- {
- Prado.Validation.groups[i].active = false;
- }
- }
- if(group)
- {
- return Prado.Validation.IsValid(group.target.form);
- }
- return true;
-};
-
-/**
- * Validate ValidationGroup
- * @param string ValidationGroup
- * @return boolean true if valid, false otherwise.
- */
-Prado.AJAX.ValidateGroup2 = function(groupId)
-{
- var groups = Prado.Validation.TargetGroups;
- for(var id in groups)
- {
- if(groups[id] == groupId)
- {
- var target = $(id);
- Prado.Validation.ActiveTarget = target;
- Prado.Validation.CurrentTargetGroup = groupId;
- Prado.Validation.IsGroupValidation = false;
- return Prado.Validation.IsValid(target.form);
- }
- }
- return true;
-};
-
-/**
- * Validate the page
- * @return boolean true if valid, false otherwise.
- */
-Prado.AJAX.ValidateOthers = function(formId)
-{
- if(Prado.Validation)
- {
- var form = $(formId);
- form = form || document.forms[0];
- Prado.Validation.ActiveTarget = form;
- Prado.Validation.CurrentTargetGroup = null;
- Prado.Validation.IsGroupValidation = false;
- return Prado.Validation.IsValid(form);
- }
- return true;
-};
-
//Available callback service
Prado.AJAX.Callback.Server = '';
|