Birthdate Field

Discussion in 'Templates customization' started by binbin, Jul 10, 2008.

  1. binbin

    binbin New Member

    Joined:
    Jan 29, 2008
    Messages:
    38
    Hello,

    I would like to add a new required field in my signup page for the birthdate but I want a field separated in 3 part like : dd mm yyyy (one field for the day, one field for the month and one field for the year).

    Someone know the issue ?
    Thanks
  2. calisolllc

    calisolllc Member

    Joined:
    Feb 19, 2007
    Messages:
    194
    If you simply wish to have them stored in the DB as 3 separate fields then its simply a matter of going to the admin control panel and under utilities theres an option for add fields, to set fields up for day month and year. It allows you to add fields and specify what forms they appear on. It also allows you to set up selection values by creating an array. e.g 1-31 for day , 1-12 for month etc
    On the other hand if you wish to inout the fields in 3 separate input boxes but actually stored as a contiguous date field then you have some programming to do
  3. skippybosco

    skippybosco CGI-Central Partner Staff Member

    Joined:
    Aug 22, 2006
    Messages:
    2,526
    binbin, is there a reason why you want to store them as 3 separate fields? As calisolllc suggests, programmatic speaking you are much better off storing them as a date field and manipulating for your needs from that (http://php.net/date)
  4. binbin

    binbin New Member

    Joined:
    Jan 29, 2008
    Messages:
    38
    Yes it's for the user, if he must fill the field of his birthdate in one field he will probably wonder if he must type a : space, a /, nothing... and because ti will be a required field I don't want he left the form because he can't at the first time to type his birthdate correctly.
    Do you understand waht I mean ? I'm enough clear?
    Thanks
  5. skippybosco

    skippybosco CGI-Central Partner Staff Member

    Joined:
    Aug 22, 2006
    Messages:
    2,526
    My suggestion would be three form fields that are combined and stored in one database field.
  6. binbin

    binbin New Member

    Joined:
    Jan 29, 2008
    Messages:
    38
    But how I can combine and store this in in one database field ? It need a hack ?

Share This Page