Quickform Question in re Groups & Popup Calendar

From: Date: Thu, 21 Aug 2003 20:01:57 +0000
Subject: Quickform Question in re Groups & Popup Calendar
Groups: php.pear.general 
Request: Send a blank email to pear-general+get-7336@lists.php.net to get a copy of this message
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. -- James 'Chip' Kaufman jkaufman@wamnet.com 651-256-5137 PGP key: 697D43DE

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