1

For a select input like this:

<select id="sn" name="sn_arvo">
    <option value="">Valitse nopeus</option>
    <option value="0">10</option>
    <option value="1">20</option>
    <option value="2">30</option>
</select>

if I add class="required" in the select node, validation works fine. But if I add it to rules:

$("#vikaformi").validate({
    debug: true,
rules: {
        sn: {
            required: true
        }

the select is not validated. Rules for text inputs for example are working. I'm using validate 1.9.

1 Answer 1

1

Shouldnt you use sn_arvo instead?

Key/value pairs defining custom rules. Key is the name of an element

sn_arvo: {
            required: true
        }

http://docs.jquery.com/Plugins/Validation/validate#toptions

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.