mercredi 18 février 2015

Validating two inputs in CKEditor dialog


I've gotten the custom validator to work on each field, but they should be mututally exclusive: how to validate one field against the other?


URL: [input1] OR Keyword: [input2]


And I can validate either one with:



setup: function() {...},
validate: CKEditor.dialog.validate.functions(function(val) {
var input1 = val; // value of THIS input field
var input2 = ???; // value of the other input field?)
return (input1 == "" || input2 == "");
},"Error message here"),
commit: function() {...}


Simplified example, but you can see what I need. A pointer to the other field from inside the validator.





Aucun commentaire:

Enregistrer un commentaire