[jQuery] [validate] How to integrate validation with masking?
Hello,
I am validating a form but one of the fields has a mask:
99-99-9999 99:99:99
This is:
Day-Month-Year Hour:Minutes:Seconds
How can I integrate my validation with my mask?
I am using:
http://digitalbush.com/projects/masked-input-plugin
http://bassistance.de/jquery-plugins/jquery-plugin-validation/
I am not sure if these are the right plugins for this ... at least
this is what I have been using.
Could someone, please, help me out?
Thanks,
Miguel
Here is my code:
// Form mask
jQuery(function($){
$("#UpdatedAt").mask("99-99-9999 99:99:99");
});
// Form validation
$("#Edit").validate({
errorClass: "Error",
errorElement: "label",
rules: {
Name: {required: true},
UpdatedAt: {required: true}
},
messages: {
Name: {required: "What is your name?"},
UpdatedAt: {
required: "Insert the updated date and time"
},
},
});