0

I have 6 sets of radio buttons, all independent of each other. Im using JQuery validation plugin to validate them(they are all required). However the validation only works on the first one the 'satisfaction' group. My validation code is here

jQuery(document).ready(function() {
$("#surveyForm").validate({
    rules: {
        satisfaction: {
            required: true
        },

        responding: {
            required: true
        },

        listening: {
            required: true
        },

        solution: {
            required: true
        },

        communication: {
            required: true
        },

        professional: {
            required: true
        }

    },
    messages:{
        satisfaction: {
            required: "this"
        },

        responding: {
            required: "is"
        },

        listening: {
            required: "a"
        },

        solution: {
            required: "test"
        },

        communication: {
            required: "to"
        },

        professional: {
            required: "see"
        }
    }
});

});

Any suggestions?

JS Fiddle

2
  • Can you show your HTML and make a fiddle? Commented Jun 19, 2013 at 21:21
  • I added a js fiddle to illustrate Commented Jun 19, 2013 at 23:40

1 Answer 1

1

You had <div id="q1"> before <form id="surveyForm">, so the matching </div> was terminating the form.

Change the order of those two lines and the problem is resolved.

FIDDLE

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

2 Comments

That was it! thanks, I cant believe I made such a stupid mistake
The browser's DOM inspector is a wonderful thing, learn to use it.

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.