FormBuilder UDT validation boilerplate code
Posted: Mon Jan 27, 2014 3:09 pm
Hi
Is there a starting block UDT that validates submitted form elements that I can use as a basis for mine? I'm having a bit of of trouble getting my UDT going. I'm getting the $params in ok - do I just reference all the fields individually and return whether this field validates? Or better, I read that there is a validate() function - can I call this and extend with my own bits?
The reason I'm using the UDT is a) I'm implementing the honeypot anti spam technique and b) checking that an 'Other info' textfield has a value based on whether an 'Other' checkbox is checked or not (it becomes required if checked). Obviously all other fields need validating at th same time.
I want to get the basic server side validation right first before using client side JS validation plugins
any help much appreciated
thanks
Is there a starting block UDT that validates submitted form elements that I can use as a basis for mine? I'm having a bit of of trouble getting my UDT going. I'm getting the $params in ok - do I just reference all the fields individually and return whether this field validates? Or better, I read that there is a validate() function - can I call this and extend with my own bits?
The reason I'm using the UDT is a) I'm implementing the honeypot anti spam technique and b) checking that an 'Other info' textfield has a value based on whether an 'Other' checkbox is checked or not (it becomes required if checked). Obviously all other fields need validating at th same time.
I want to get the basic server side validation right first before using client side JS validation plugins
any help much appreciated
thanks