QuickForm:Date
| From: | Daniel Demacek | Date: | Wed, 01 Oct 2003 09:40:27 +0000 |
| Subject: | QuickForm:Date | ||
| Groups: | php.pear.general | ||
| Request: | Send a blank email to pear-general+get-8168@lists.php.net to get a copy of this message | ||
Hi,
Consider the follwing:
$bdoptions = array(
'language' => 'en',
'format' => 'dMY',
'minYear' => 1920,
'maxYear' => date("Y")
);
$form->addElement('date', 'p_bday', 'Your Birthday:',
$bdoptions);
$form->addRule('p_bday', 'Birthday is required', 'required');
# validate bday
function isValidBDay($fields)
{
if(!checkdate($fields['p_bday']['M'],
$fields['p_bday']['d'],
$fields['p_bday']['Y']) )
{
$ar = 'Please enter valid birthday';
}
if(!empty($ar))
return $ar;
else
return true;
}
$form->addFormRule('isValidBDay');
Fatal error: Unsupported operand types in
/usr/local/lib/php/HTML/QuickForm.php on line 1448
Thanks, Dan.