Page 1 of 1
popup calendar [SOLVED]
Posted: Thu Aug 23, 2007 5:43 am
by sabatier
Hi all, I'm new to php. Is it possible to implement a popup calendar in php where you can select a date and time without using javascript? Something along the lines of the ones shown here:
http://www.softcomplex.com/products/tig ... demo1.html
If possible I want to be able to convert the input to the format "YYYY-MM-DDThh:mm:ss" (this is the dateTime data type used in XML schema).
Any help would be greatly appreciated,
Ruth
Posted: Thu Aug 23, 2007 5:54 am
by Steve Mellor
I don't think there's any way of doing it purely in PHP. At some point you will need Javascript firstly to open the popup window and also if you want to update a form element dynamically. If you're using Javascript then you might as well use a Javascript calender. Take a look at the one at
https://engineering.purdue.edu/ECN/Supp ... 0414131404 if you're after one which is easy to use and style.
Posted: Thu Aug 23, 2007 6:06 am
by CoderGoblin
Calendars can be produced quite easily using PHP. The difficulty is how does the user interact with it. PHP only updates things on the server side so the user would have to basically refresh the entire page every time they change something (change month/year etc and well as select the actual date). Javascript is on the client side and as a result uses the persons own browser to process what it needs without having to go to the server. To get the 'look and feel' of the calendar you pointed to, javascript is really the only solution.
For those people without javascript in this sort of instance it is important to add some text such as 'Format : dd/mm/yyyy' possibly using the <noscript> HTML tag. All validation of any form should be performed with php in the end anyway so you have a situation where those people who don't have javascript have the restriction of having to type a date. Those people with javascript have a nice popup.
As I use the jquery javascript anyway nowadays I would tend to use the
Jquery DatePicker calendar.