Re: Re: QuickForm and submit processing
| From: | Maximillian Schwanekamp | Date: | Sat, 13 Aug 2005 21:26:23 +0000 |
| Subject: | Re: Re: QuickForm and submit processing | ||
| References: | 1 2 | Groups: | php.pear.general |
| Request: | Send a blank email to pear-general+get-20409@lists.php.net to get a copy of this message | ||
zorro wrote:
Yes, this can be done, but it depends on how you're using QF. Are you using the default renderer, or are you using a template engine? I use the QF with Smarty, and use the bundled HTML_QuickForm_Renderer_ArraySmarty to get form markup. In my case, I omit the default form.attributes string (which includes the onsubmit attrib string) and replace it with something else. If you're using the default renderer, you might consider extending it to your liking; another option might be to use HTML_QuickForm_Renderer_Array which works almost the same as the Smarty renderer; or perhaps a better solution would be to use DHTML to replace the onsubmit with a submit event listener that calls your own function, which itself calls the validation script before giving a confirmation dialog. HTH -- Max Schwanekamp http://www.neptunewebworks.com/If I have a HTML_QuickForm with client side validation then it will have an "onsubmit" that points to the validation javascript in the resulting page. Now if I want to add an "Are you sure?" confirmation dialog after the client side validation has passed, how can I do that?What I would like is some way to have a javascript function called onsubmit but after the validation javascript is successful. Can this be done?