|
@ -263,12 +263,6 @@ $.fn.form = function(parameters) { |
|
|
} |
|
|
} |
|
|
}); |
|
|
}); |
|
|
return allValid; |
|
|
return allValid; |
|
|
}, |
|
|
|
|
|
validHTMLID(value) { |
|
|
|
|
|
if(typeof value !== 'string') { |
|
|
|
|
|
return false; |
|
|
|
|
|
} |
|
|
|
|
|
return value.search(regExp.htmlID) !== -1; |
|
|
|
|
|
} |
|
|
} |
|
|
}, |
|
|
}, |
|
|
|
|
|
|
|
@ -485,7 +479,8 @@ $.fn.form = function(parameters) { |
|
|
}, |
|
|
}, |
|
|
field: function(identifier) { |
|
|
field: function(identifier) { |
|
|
module.verbose('Finding field with identifier', identifier); |
|
|
module.verbose('Finding field with identifier', identifier); |
|
|
if(module.is.validHTMLID(identifier) && $field.filter('#' + identifier).length > 0 ) { |
|
|
|
|
|
|
|
|
identifier = module.escape.string(identifier); |
|
|
|
|
|
if($field.filter('#' + identifier).length > 0 ) { |
|
|
return $field.filter('#' + identifier); |
|
|
return $field.filter('#' + identifier); |
|
|
} |
|
|
} |
|
|
else if( $field.filter('[name="' + identifier +'"]').length > 0 ) { |
|
|
else if( $field.filter('[name="' + identifier +'"]').length > 0 ) { |
|
@ -600,10 +595,11 @@ $.fn.form = function(parameters) { |
|
|
|
|
|
|
|
|
field: function(identifier) { |
|
|
field: function(identifier) { |
|
|
module.verbose('Checking for existence of a field with identifier', identifier); |
|
|
module.verbose('Checking for existence of a field with identifier', identifier); |
|
|
|
|
|
identifier = module.escape.regExp(identifier); |
|
|
if(typeof identifier !== 'string') { |
|
|
if(typeof identifier !== 'string') { |
|
|
module.error(error.identifier, identifier); |
|
|
module.error(error.identifier, identifier); |
|
|
} |
|
|
} |
|
|
if(module.is.validHTMLID(identifier) && $field.filter('#' + identifier).length > 0 ) { |
|
|
|
|
|
|
|
|
if($field.filter('#' + identifier).length > 0 ) { |
|
|
return true; |
|
|
return true; |
|
|
} |
|
|
} |
|
|
else if( $field.filter('[name="' + identifier +'"]').length > 0 ) { |
|
|
else if( $field.filter('[name="' + identifier +'"]').length > 0 ) { |
|
@ -617,6 +613,13 @@ $.fn.form = function(parameters) { |
|
|
|
|
|
|
|
|
}, |
|
|
}, |
|
|
|
|
|
|
|
|
|
|
|
escape: { |
|
|
|
|
|
string: function(text) { |
|
|
|
|
|
text = String(text); |
|
|
|
|
|
return text.replace(regExp.escape, '\\$&'); |
|
|
|
|
|
} |
|
|
|
|
|
}, |
|
|
|
|
|
|
|
|
add: { |
|
|
add: { |
|
|
prompt: function(identifier, errors) { |
|
|
prompt: function(identifier, errors) { |
|
|
var |
|
|
var |
|
|