0

This is jQuery code while button click the for loop is not working in dialog div submit date button please some one help me friends. . .

$("#dialog-form").dialog({
    autoOpen: false,
    height: 300,
    width: 350,
    modal: true,
    buttons: {
        "Submit Date": function () {
            for (var j = 1; j <= MGDval; j++) {
                alert($('S' + j).val());
            }
            $(this).dialog("close");
        },
        Cancel: function () {
            $(this).dialog("close");
        }
    },
    close: function () {
        $(this).dialog("close");
    }
});
2
  • where is you MGDval is defined? Commented Feb 15, 2014 at 9:57
  • that is global variable value is 2 Commented Feb 15, 2014 at 9:58

2 Answers 2

2
alert($('S'+j).val());

change to :

alert($('#S'+j).val()); // => for ID

alert($('.S'+j).val()); // => for Class

if selector element "S" : "#S" or ".S"

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

Comments

0
s does nor refer to any thing chnage to .s for class or #s for Id

alert($('#S'+j).val());

alert($('.S'+j).val());

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.