3

I have a very basic confirmation dialog that have 2 buttons:"Ok" & "Cancel". Here is the demo :http://jsfiddle.net/VQmAm/11/

Now I need to add to that confirmation dialog: some radio buttons and the user would select only one of these values and I would take that value to use it later.

I have found set of ways to do that other than JQuery, but I was wondering if I can do that via JQuery!

1 Answer 1

3

Add the radio buttons (with same name attribute) to the #confirmDialog div. Then, you can get the selected value with the OK button:

        'OK': function() {
            value = $(this).find('input:checked').val();
            $(this).remove();
        },

Note that you get the value before removing the dialog. And you should define the var value outside the function.

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.