Results 1 to 2 of 2

Thread: Formating a field in the form
      
   

  1. #1
    ptnfl is offline Staff Sergeant
    Join Date
    Feb 2007
    Posts
    43

    Default Formating a field in the form

    Can you format a field in a form i.e. date(00/00/0000, time0:00) etc.?

    Pete

    www.MusicGrams4U.com

  2. #2
    Andy128's Avatar
    Andy128 is offline Major General
    Join Date
    Dec 2005
    Location
    Michigan
    Posts
    2,322

    Default 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?

    Andy
    PHP- is a blast!

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

     

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49