formbuilder subform and clientrules validation
| From: | Andrew Wooldridge | Date: | Sat, 07 Jan 2006 01:19:02 +0000 |
| Subject: | formbuilder subform and clientrules validation | ||
| Groups: | php.pear.general | ||
| Request: | Send a blank email to pear-general+get-22468@lists.php.net to get a copy of this message | ||
has anyone combined clientrules validation with optional subforms using formbuilder?
i'm having problems: clientrules with a subform doesn't work. here is why....
when the parent form is made using getForm() method it adds the clientside validate js function to the form tab (called validate_dataobjects_hist_proc in pasted code below)..
problem is... you have to create the form before you can append the subform....
i set clientrules to true on both my parentform and my child subform. the appropriate javascript for subform validation gets added to the html source for the subform validation...but the page is never told to run the subform js function during the onsubmit handler. (see onsubmit below)
---explanatory snippet---
<form action="/CLQTS/editevent.php?type=proc" method="post" name="dataobjects_hist_proc" id="dataobjects_hist_proc" target="_self" onsubmit="try { var myValidator = validate_dataobjects_hist_proc; } catch(e) { return true; } return myValidator(this);">
---
Any advice or prior examples greatly appreciated. -A