Hello,

on 01/03/2006 06:41 PM Sue said the following:
I need to create a form that allows the user to select a Month, Day and Year. I am also new to PHP and am wondering if there is a way for me to display the contents of the Select list box (for the Day) based on the Month that is selected (and Year), so that the valid number of days for the month (& year?) displays. For all of our other forms, we use CGI to handle our standard forms validation, and was hoping to handle more complex validation within PHP prior to sending the entire contents of my form to our standard CGI validation routine. I know that I could use the Checkdate function once the entire date is selected, but thought there might be an easier/more efficient way of handling this and also not sure how to reference Checkdate prior to Submitting my form to the CGI routine. I also was not sure if this was something that is handled easier using Javascript? Any help/examples, etc. would be greatly appreciated!

You may want to try this forms generation and validation class. It comes with a calendar date plug-in that does exactly what you want.

It lets you choose a date using several text or select fields and it can validate the date that you choose using special Javascript code generated by the plug-in. If you want, it can also restrict the range of accepted dates, like since a given date or no later than another date.

The plug-in class validates either on the client side with Javascript or server side with PHP. You do not need to know any Javascript to use this.

http://www.phpclasses.org/formgeneration


Here is a screen shot:

http://www.phpclasses.org/browse/file/8245.html


Here is an example page:

http://www.phpclasses.org/browse/view/html/file/6799/name/test_date_input_page.html

--

Regards,
Manuel Lemos

Metastorage - Data object relational mapping layer generator
http://www.metastorage.net/

PHP Classes - Free ready to use OOP components written in PHP
http://www.phpclasses.org/

--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php

Reply via email to