获取类Form中的所有ID以更改文本输入表单中的“setCustomValidity”

时间:2014-04-29 10:05:41

标签: javascript

这里是代码

function getId(){
$.each($('.myForm'), function() {
var get = this.id ; \\ allert this & the masssage show with this id
var val = this.value ;
    if (val == ''){
        this.focus(); 
this.setCustomValidity('My custom validation message'); \\same message in each text
        return false;
    }else { return true; }});}

问题是:  焦点不想移动(总是在textinput中已经有值) 我该怎么做才能解决它?

0 个答案:

没有答案
相关问题