I need a jquery form dialog that calls a function with two parameters after it accepts the form. One parameter is from the form and another one from where the dialog is initialized/opened.
how should I do this without using global variables?
edit:
$("#something").click( function(){
var global_var=param2;
$('#dialog').dialog('open');
}
$('#dialog').dialog({modal: true,
autoOpen: false,
buttons: {'Cancel': function(){}
'Accept': function(){ callback($('#widget').val(),global_var);}
}
});
<div id="#dialog">
<p>
<input type="text" id="widget" />
</p>
</div>
you can try create input hidden with your param2: