FormBuilder Element Group Processing
| From: | Orya | Date: | Wed, 10 Dec 2003 06:34:36 +0000 |
| Subject: | FormBuilder Element Group Processing | ||
| Groups: | php.pear.general | ||
| Request: | Send a blank email to pear-general+get-9444@lists.php.net to get a copy of this message | ||
Hi,
This is my first time posting to this list, I hope I'm going about it the right way. I am in a situation where I have used FormBuilder to generate a form of which two elements are dates. Now I have defined them as such in the DataObject so they appear as pop-up selects in the HTML page. My problem is that I would like to give the possibility of not entering a date (i.e. NULL value) and I haven't figured out an efficient solution yet.
My thoughts are to create an element group containing a date value and a checkbox, if the checkbox isn't set the date selects would be disabled (via javascript.) To do this I need to 1) Add the group to the form and replace the existing date fields 2) add form processing that determines whether checkbox is on or off and determines whether to set date to NULL or not 3) write the javascript
Could you share with me your opinions on the best methods for accomplishing 1 and 2? For example, should I override the getForm() method or can I replace the particular elements with groups in another manner?
Very much appreciated,
Orya