Fixed a bug for processing conditional validation.

git-svn-id: http://xe-core.googlecode.com/svn/branches/1.5.0@9310 201d5d3c-b55e-5fd7-737f-ddc643e51545
This commit is contained in:
taggon 2011-09-23 07:34:10 +00:00
parent 86777cf4f7
commit ac86609035

View file

@ -145,9 +145,9 @@ var Validator = xe.createApp('Validator', {
if(f['if']) {
if(!$.isArray(f['if'])) f['if'] = [f['if']];
for(i in f['if']) {
for(i=0;i<f['if'].length;i++) {
if_ = f['if'][i];
fn = new Function('el', 'return !!(' + (if_.test.replace(/$(\w+)/g, 'el["$1"]')) +')');
fn = new Function('el', 'return !!(' + (if_.test.replace(/\$(\w+)/g, 'el["$1"].value')) +')');
if(fn(elems)) f[if_.attr] = if_.value;
}
}