For Programmers: Free Programming Magazines  


Home > Archive > PHP Pear > June 2004 > problem with html_quick_form date









You are viewing an archived Text-only version of the thread. To view this thread in it's original format and/or if you want to reply to this thread please [click here]

 

Author problem with html_quick_form date
Jerry

2004-06-29, 8:56 am

Good morning


I've a problem with html_quick_form date element . I've the following error
message :

Notice: strtotime(): Called with empty time parameter in
/var/www/appli-box.com/htdocs/pear/PEAR/HTML/QuickForm/date.php on line 373

Could someone help me??

Here's my script :

function preGenerateForm(&$formBuilder)

{



$el = array();




$tabattributes['language']='fr';

$tabattributes['minYear']='2004';

$el['OPR'] = &HTML_QuickForm::createElement('date', 'OPR',
'OPR',$tabattributes);





$this->preDefElements = &$el;

}



function postGenerateForm(&$form)
{




if(isset($this->id)){

$tabOPR=array('d' => date('d', strtotime($this->OPR)), 'M' => date('m',
strtotime($this->OPR)), 'Y' => date('Y', strtotime($this->OPR)));

}else{

$tabOPR=array('d' => date('d'), 'M' => date('m'), 'Y' => date('Y'));

}

$constantValues['OPR'] = $tabOPR ;






$form->setDefaults($defaultsValues);
$form->setConstants($constantValues);
}
Sponsored Links







Also available: Server administration forum archive | Web Design forum archive | Software forum archive | Hardware reviews archive

Copyright 2008 codecomments.com