QuickForm: client validation question
| From: | Tim Glen | Date: | Wed, 01 Mar 2006 00:00:58 +0000 |
| Subject: | QuickForm: client validation question | ||
| Groups: | php.pear.general | ||
| Request: | Send a blank email to pear-general+get-23166@lists.php.net to get a copy of this message | ||
Hey all,
Here's my issue, I need to use the HTML_QuickForm client validation as a test to see whether to run my AJAX call.
Here's what the onsubmit looks like by default:
onsubmit="try {var myValidator = validate_my_form;} catch(e) {return true;}return myValidator(this);"
Here's what I basically need to do:
if(try {var myValidator = validate_my_form;} catch(e) {return true;}return myValidator(this);){new Ajax.Request('/controller/action', {options}, asynchronous:true, parameters:Form.serialize(this)})}; return false;
This returns an error. I also tried wrapping an eval('') call around the validation code, which fixed it in Safari but still returns an error in FF and IE. I was hoping to avoid having to extend the QuickForm class in order to fix this (since it will take a bit of acrobatics for my app).
anyone have any ideas?
--
tim glen
senior developer
nonfiction studios inc.
http://nonfiction.ca/
p 403 686 8887