开发者

jquery validate - fail on radio

I have a form that's checked by jquery validate. The field that's causing some issue looks like this:

<label>Select an Account Type<</label><br>

<input type="radio" name="accountType" value="1" id="accountType_C"><label id=开发者_Python百科"accountType_C" for="accountType_C">Coder</label>
<input type="radio" name="accountType" value="0" id="accountType_S"><label id="accountType_S" for="accountType_S">Surreptitious Ninja</label>

All other fields in the form validate appropriately with the exception of the one above. Not quite sure what I'm doing wrong. There's about 12 other fields that get validated with no issue. I've double checked the validate for duplicate declarations but there are none.

Here's the validate function:

$("#regForm").validate({

    rules: {

        accountType: "required"

    },

    messages: {

        accountType: "You must select an account type"

    }

});

Thanks much!


$("#regForm").validate({

        rules: {

                accountType: "checked"

        },

        messages: {

                accountType: "You must select an account type"

        }

});


Just for the record ;)

$("#regForm").validate({
    rules: {
        accountType: { required: true }
    },
    messages: {
        accountType: "You must select an account type"
    }
});
0

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜