开发者

Storing date into mysql using html form

I have a html form where I require users to enter their birthdate.

<label for="dob">Date of birth </label>
<input id="dob" name="dob" type="date" 开发者_开发百科/>

I'm using this script to validate the form - http://livevalidation.com/examples#exampleFormat

By default, it doesn't include any regex expression for date validation.So could you please help me to get date from the user in this format dd-mm-yyyy format and validate it.

Also, I've set mysql as date type so can i be able to store it by default or do i need to change its format.


jQuery Validation Plugin can also validate as you type and works with Dates fields using JavaScript built-in Date() method to validate. So, maybe you would rather mix the two plugins instead of customizing LiveValidation with a complex reg-ex?

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜