I'm working on a PHP frontend for a PostgreSQL db and I'm looking for the
best way to create date or timestamp inputs. Let's take a date in the
format yyyy-mm-dd as an example. This is too error prone, I know my users
will do it wrong
<input type="text" name="fieldname ">
Right now I'm thinking about something like this:
<input type="text" size="4" name="y_fieldna me">-
<input type="text" size="2" name="m_fieldna me">-
<input type="text" size="2" name="d_fieldna me">
but this is IMO a very ugly solution, because after the SUBMIT I have to
glue all the parts together before inserting the values into the db.
Something like this:
<input type="text" format="yyyy-mm-dd" name="fieldname ">
would be ideal, but AFAIK this doesn't exist in HTML. Can anybody give me
any tips? How did you solve this? Thanks!
best way to create date or timestamp inputs. Let's take a date in the
format yyyy-mm-dd as an example. This is too error prone, I know my users
will do it wrong
<input type="text" name="fieldname ">
Right now I'm thinking about something like this:
<input type="text" size="4" name="y_fieldna me">-
<input type="text" size="2" name="m_fieldna me">-
<input type="text" size="2" name="d_fieldna me">
but this is IMO a very ugly solution, because after the SUBMIT I have to
glue all the parts together before inserting the values into the db.
Something like this:
<input type="text" format="yyyy-mm-dd" name="fieldname ">
would be ideal, but AFAIK this doesn't exist in HTML. Can anybody give me
any tips? How did you solve this? Thanks!
Comment