0

jquery validate によってチェックされるフォームがあります。問題を引き起こしているフィールドは次のようになります。

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

<input type="radio" name="accountType" value="1" id="accountType_C"><label id="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>

上記のフィールドを除いて、フォーム内の他のすべてのフィールドは適切に検証されます。私が間違っていることはよくわかりません。問題なく検証される他の約 12 のフィールドがあります。重複宣言の検証を再確認しましたが、何もありません。

検証関数は次のとおりです。

$("#regForm").validate({

    rules: {

        accountType: "required"

    },

    messages: {

        accountType: "You must select an account type"

    }

});

どうもありがとう!

4

2 に答える 2

1
$("#regForm").validate({

        rules: {

                accountType: "checked"

        },

        messages: {

                accountType: "You must select an account type"

        }

});
于 2009-10-07T06:32:01.633 に答える
0

記録のためだけに;)

$("#regForm").validate({
    rules: {
        accountType: { required: true }
    },
    messages: {
        accountType: "You must select an account type"
    }
});
于 2011-08-11T14:42:29.747 に答える