开发者

Using jquery validator plugin

开发者 https://www.devze.com 2023-03-16 20:57 出处:网络
I am using jquery 开发者_开发问答validator plugin to validate a form on my website. I have got a birthdate field for which I want to perform validation that birthdate should be chosen and a custom err

I am using jquery 开发者_开发问答validator plugin to validate a form on my website. I have got a birthdate field for which I want to perform validation that birthdate should be chosen and a custom error message should be displayed. For birthdate I have got three dropdown lists of day, month and year for which I want to display a single error message. Like if I don't choose a month or year the error will be displayed. It will be only gone if all the three values are selected. How can I do this? The error message can be " Please select a birthdate". Below is a code for validating a single dropdown element. I want mutiple validation to be performed. {

$(document).ready(function(){
$("#register").validate({
        rules: {
                day:"required"
               }
        message: {
                day:"Please select birthdate"
                 }
});
  });}
0

精彩评论

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