returning values from dialog to another dialog
Permalink
Hi,
I'm building a block but I'm stuck at the following problem...
When adding or editing a block, it will open in a dialog window. I made a button that opens another dialog window from (within) the current one. The second one holds a form with text formfields. The fields from the second dialog should be copied to a hidden field in the first dialog window and then close the second window....Still with me?
Opening the dialog is no problem but copying the formdata and closing the second window isn't working...
Can anyone help me?
Thank you for your time!
I'm building a block but I'm stuck at the following problem...
When adding or editing a block, it will open in a dialog window. I made a button that opens another dialog window from (within) the current one. The second one holds a form with text formfields. The fields from the second dialog should be copied to a hidden field in the first dialog window and then close the second window....Still with me?
Opening the dialog is no problem but copying the formdata and closing the second window isn't working...
Can anyone help me?
Thank you for your time!
ok... well... bear in mind I haven't tested any of this, but it works in my head and I reckon all browsers should be based on what works in my head, so give it a go... :)
Dialog box 2:
Give your form a unique id (eg #dialogForm2).
When the user clicks save, grab all fields inside that form (eg var myFormData = $('#dialogForm2').serialize(); Docs on that are here:http://api.jquery.com/serialize/... ).
The fields in the first Dialog box should still be available to you here, so add the data to your hidden field (eg $('#dialog1 #hiddenfield).attr('value', myFormData);)
Then close your dialog.
Would that work for you??
Jon
Dialog box 2:
Give your form a unique id (eg #dialogForm2).
When the user clicks save, grab all fields inside that form (eg var myFormData = $('#dialogForm2').serialize(); Docs on that are here:http://api.jquery.com/serialize/... ).
The fields in the first Dialog box should still be available to you here, so add the data to your hidden field (eg $('#dialog1 #hiddenfield).attr('value', myFormData);)
Then close your dialog.
Would that work for you??
Jon
Hi Jon,
I'll try it as soon as i can.
Thank you for your input! Much appreciated!
I'll try it as soon as i can.
Thank you for your input! Much appreciated!
Is the question that hard or doesn't anyone understand the question?
Please help, anything can be helpful!