Terak wrote:
I'm using cakephp framework and I'm running into problem if the
element name if different from the element ID.  Currently the form is
getting submitted w/o being validated, but if I change the textarea
name to "contact_description" then it will validate it.  Also I would
like to make sure that atleast 1 checkbox has been selected but i'm
not sure how to add a custom function to multiple checkbox.
Validation rules have to refer to the name of elements. Due to a bug in the plugin, the notation used by CakePHP didn't work. Unfortuanetely I've discovered that after releasing 1.1. Until the next release you can try to patch the errorsFor-method manually:

errorsFor: function(element) {
        return this.errors().filter("[EMAIL PROTECTED]'" + this.idOrName(element) + 
"']");
},

Validating multiple checkboxes is easy, just a rule for the name of them.

--
Jörn Zaefferer

http://bassistance.de

Reply via email to