Formating a field in the form
Collapse
X
-
Re: Formating a field in the form
First- what are you trying to accomplish?
Is the date automatically input when the person submits the form?
Or- do you wish to convert the date / time that they enter and put it in a specific format?
IF it is converting the date and time that they enter- Then I would suggest specific instructions on the form to tell the customer just how you want the data input. Even give an example: 01/01/2007 11:20:00
Additinonally, because it is difficult to tell who is entering the data and the date is formated different in many cultures- I would break the fields up into Day-Month-Year and Hours -Minutes. Then you could have the php script put all these together in the format you desire.
If you are wanting the date to be automatically sent at the time of the submission- then the date() function will work for this. In your php script simply ad a line where you declare your variables.
$date = date("m-d-Y h:i:s");
Hope that is what you are looking for?
AndyPHP- is a blast!
-
Comment