Re: Quickform Question in re Groups & Popup Calendar

From: Date: Thu, 21 Aug 2003 20:46:23 +0000
Subject: Re: Quickform Question in re Groups & Popup Calendar
References: 1  Groups: php.pear.general 
Request: Send a blank email to pear-general+get-7341@lists.php.net to get a copy of this message
<jkaufman@wamnet.com> wrote : > Is it possible to create a group that consists of a text field and an > image such that the text field contains a date and the image if clicked > will call a Javascript function that pops up a calendar, then fills in > the date field with the new data. I have this, but it doesn't work*: > > $text_field = &HTML_QuickForm::createElement('text', 'text_field'); > $image_field = &HTML_QuickForm::createElement('html', " > <a HREF='#' onClick=\"return > getCalendar('form.text_field')\"> > <img SRC='calendar.png' BORDER='0'></a>"); > $form->addGroup(array($text_field, $image_field), '', 'Meeting > Date'); > > It generates html that looks like: > > <a HREF='#' onClick="return > getCalendar('form.text_field')"> > <img SRC='calendar.png' BORDER='0'></a> > <tr> > <td align="right" valign="top"><b>Meeting > Date</b></td> > <td valign="top" align="left"><input > name="text_field" > type="text" value="02/10/2003" /></td> > </tr> > > * Doesn't work means: 1) The html code is generated outside of the > <tr>...</tr> section, so it doesn't appear within the table next to the > text field. It appears at the top of the page. 2) After selecting a > date from the popup menu, the text field does not show the new value, > though the "same" code works outside of Quickform. Did you try with a static element instead of a html element ? Example: $image_field = &HTML_QuickForm::createElement('static', 'calBtn', null, "<a HREF='#' onClick=\"return getCalendar('form.text_field')\"><img SRC='calendar.png' BORDER='0'></a>"); Bertrand Mansion Mamasam

« previous php.pear.general (#7341) next »