Re: DB_DO_FormBuilder - date field as a jscalendar!
| From: | Phillip Novess | Date: | Tue, 31 Jan 2006 22:45:27 +0000 |
| Subject: | Re: DB_DO_FormBuilder - date field as a jscalendar! | ||
| References: | 1 2 3 4 | Groups: | php.pear.general |
| Request: | Send a blank email to pear-general+get-22739@lists.php.net to get a copy of this message | ||
That's pretty cool!
However, it's pretty much still in it's infancy and has problems with IE. The website even recommends going to Dynarch for another option. Dynarch is the source for jscalendar.
The method that I hacked together works. It just would be nice to have it be more polished. As I know many of programmers here have the skills to take it to that level.
Thanks,
phill
On Jan 31, 2006, at 3:18 PM, Anselm Heaton wrote:
Hugo wrote :
Philip wrote :How I make my form date field as a jscalendar using DB_DataObject_FormBuilder?
I had to hack together a quickform element.Another way to do this is to use unobstrusive javascript. The idea being that you create a normal input, and javascript comes behind the scenes to add the datapicker - it means your form logic is free from your widget logic. You can find a nice datepicker that does this here : http://www.frequency-decoder.com/٢٠٠٥/١٠/١٤/unobtrusive-date-picker-widgit/ With FormBuilder and the mentioned date picker, you could add the following to your DB_DataObject : $fb_elementTypeAttribute = array('date' => array('class' => 'format-d-m-y')); $fb_elementTypeMap = array('date' => 'HTML_QuickForm_Text'); And include the datepicker javascript in your html file. I haven't tested this yet (I am planning too!) so there might be some unexpected problems (let us know if there are!) but otherwise, it should just work this way. Anselm -- ------------------------------ Netuxo Ltd a workers' co-operative providing low-cost IT solutions for peace, environmental and social justice groups and the radical NGO sector Registered as a company in England and Wales. No ٤٧٩٨٤٧٨ Registered office: ٥ Caledonian Road, London N١ ٩DY, Britain ------------------------------ email office@netuxo.co.uk http://www.netuxo.co.uk ------------------------------ -- PEAR General Mailing List (http://pear.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php