placeholder issue with jQuery Validate

前端 未结 9 625
时光说笑
时光说笑 2020-12-31 19:10

I noticed today that we have an issue with jquery Validate when used in conjunction with placeholder text.

Example:

&
9条回答
  •  一整个雨季
    2020-12-31 19:44

    My quick solution:

                $(".validateForm").submit(function(){
                $(this).find("input[type=text]").each(function(){
                    if($(this).attr("placeholder") == $(this).val())$(this).val("");
                })
            })
    

提交回复
热议问题