|
|
|||||||||
|
|||||||||
|
|||||||||
| |
|||
| |||||||||
![]() |
|
|
«
Previous Thread
|
Next Thread
»
|
Thread Tools | Search this Thread | Display Modes |
|
|
|
Stay one step ahead of the competition. Evaluate and give feedback
on some of the hottest web development tools on the market today.
Make your opinion heard! Click
Here
|
|
#1
|
|||
|
|||
|
Date question
I am trying to add a date to a mysql database from a form. However I do not want to limit the user to entering the date as follows (YYYYMMDD). I would like the user to be able to enter the date in as (MM-DD-YYYY). If anyone can help me with this that would be great.
Thanks in advance for your help and time!!! |
|
#2
|
|||
|
|||
|
This is a tough one.
Just think about the issues you are going to face when trying to figure out what this means: 01-02-2003 Is that January 2nd? Is that February 1st? I have a couple suggestions, Why not have the date entered by a date selection drop down: Month - Day - Year dropdowns I wrote a class that eases this... and there are many free ones as well. You could also use a javascript calendar date picker. There are lots of nice ones, just use google to find them. My last suggestion is if you really want to have them type this all out manually, why not have dynamic form elements. If they click a box they can activate the YYYYMMDD formate, or another box activates the MM-DD-YYYY format. Now you can parse these effectively. Try not to make things too hard on yourself. Its not worth it.
__________________
__________________________________________________ _ Wil Moore III, MCP | Integrations Specialist | Senior Consultant Are You Listed...? | DigitallySmooth Inc. |
|
#3
|
|||
|
|||
|
I'm not sure what you mean as far as a class file to handle drop downs for the date. I have been trying to figure it out, but have had no luck. Any assistance would be great!!!
Thanks. |
|
#4
|
||||
|
||||
|
I would create a seperate input on the form for month, date and year. In my php code I would join the variables together to get them in the MySQL format
__________________
CHornJr "One day I'll know what I am doing" ![]() My Blog Suanhacky Lodge #49 Rebel Squadrons |
|
#5
|
|||
|
|||
|
Quote:
Check out this post: http://www.devarticles.com/forum/sh...s=&postid=16783 |
![]() |
| Viewing: Dev Articles Community Forums > Programming > General Programming Help > Date question |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|
|
|