Jump to content

Birthday field & regex


sh16

Recommended Posts

Hi everybody,

 

we want to insert a field "birthday" in our client area in the customer data. This we have the following questions:

 

  • We need to include three fields (day, month, year)?
  • What kind of regex we need to insert? So that only numbers can be added?

 

Best regards,

sh16

Link to comment
Share on other sites

We need to include three fields (day, month, year)?

one field will be enough if you have the right regex syntax

 

What kind of regex we need to insert? So that only numbers can be added?

the following will accept two date format (2012-10-23) and (2012/10/23):

/^[0-9]{4}[-\/](0[1-9]|1[0-2])[-\/](0[1-9]|[1-2][0-9]|3[0-1])$/

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use & Guidelines and understand your posts will initially be pre-moderated