Login Retreive lost passwordRegister
Search

Forum Index / Feedback / datefield

[ This topic is solved ]

  Eris 13 April 06 / 10:49  
First att all its working great but I got "one problem"

For my websites i am using y-m-d to put dates in my database but on my website i still preffer d-m-y because visitors understand it better. Is it posible to have 2 format. 1 for user input and 1 for the database output.

(And yes i know i can use it easy with php manually.)

Maybe a nice addition...

Eris

  Teye Heimans (Founder) 13 April 06 / 11:00  
If you use a recent version of FH (not version 1) then FormHandler will convert the date automaticaly so that it can be inserted into the database. So, if you give a mask like "m-d-y", "Y-d-m" or whatever, FormHandler will convert it automatically to y-m-d format.

  Eris 13 April 06 / 12:20  
Very strange then. Im a using the newest version FH3 1.2.1 (from 1 april)

And take a look at my example (Posted on phphulp to promote this fantastic thing ;))

http://www.phpclub.nl/highlight.php?file=voorbeeld2.php

When i post this form the $data['u_gbd'] will show as 22-12-1983 instead 1983-12-22

Eris

  Teye Heimans (Founder) 13 April 06 / 13:14  
There is nothing strange at it. FormHandler will change the datefields value into the correct format when you use the database option. In your onCorrect/onSaved function, the date is just returned just like the way it is entered by the form. So, if you have a mask like d-m-y, you will also get the dates in that way.

  Teye Heimans (Founder) 13 April 06 / 13:15  
See also http://www.formhandler.net/index.php?pg=20&id=33

  Top


powered by PHP-GLOBE   © 2004 - 2012 FormHandler. All rights reserved.   -   Open source license