Re: QuickForm 'date' element, how to setDefault date ?

From: Date: Tue, 03 Feb 2004 14:43:28 +0000
Subject: Re: QuickForm 'date' element, how to setDefault date ?
References: 1  Groups: php.pear.general 
Request: Send a blank email to pear-general+get-10496@lists.php.net to get a copy of this message
-----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 On Monday 02 February 2004 17:43, Levy wrote: > Hi all. > > Want to thank you people that helped me out previously with my > problem. > > Another one came up, I can't figure out how to set the default values > for the 'date' element in QuickForm. Anyone got this solved ? > > Levy Something like: $defaults['month_year'] = array('M'=>date('m'), 'Y'=>date('Y')); $form->setDefaults ($defaults); $form->addElement ('date', 'month_year', 'Date:', array('format'=>'MY', 'minYear'=>2000, 'maxYear'=>date('Y')+1)); This will display a date chooser defaulting to current month and year. - -- James 'Chip' Kaufman jkaufman@wamnetgov.com 952-346-3532 PGP key: 697D43DE -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.2.1 (GNU/Linux) iD8DBQFAH7OQrlGDUWl9Q94RAnvmAKC5QV8ffDt+5i0DQY6DCNovBohntQCbBPbs KVXac+NBrKX7Wb39utJyDMQ= =F062 -----END PGP SIGNATURE-----

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