1

Is there any way to make each one of the buttons that makes up an array, opens a form using jQuery Dialog and that when the form is filled out, its content is stored in a hidden field in the same row of the button that opened the modal form?

I have post an example at jsFiddle.net : http://jsfiddle.net/UQFxP/14/

In that example you can see a colum (Add Reason) of buttons. Well, I need that all of those buttons open a dialog as the big "Add" button bellow the table does, but I have no idea how to do it :(

Hope you can help with this

2 Answers 2

2

Not really sure if it's what you need, but check http://jsfiddle.net/UQFxP/25/

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

2 Comments

it works fine, but one more question : how could I add the value of the textarea to the hidden field that's next to the button that opened the dialog ??? :(
Change the type of input from text to hidden. I changed it to text, so I could see whether the value is set or not. And if what you really need is adding check jsfiddle.net/UQFxP/47
1

Try this: add a name to all of the buttons, say "add" and then in jquery add this:

 $("button[name=add]").click( function() {
            $( "#formReason" ).dialog( "open" );

  });

Comments

Your Answer

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