asp.net mvc - How can I close one jQuery UI Dialog and focus on another? -
After my call to
$ .ajax (), all UI dialogs are currently closed and according to the page a complete postback It seems to be Firebug - this is not what I need. I want to list ** UI dialog ** (Read: Partial view) is visible, then the "Create" button is pressed to open another UI dialog to create an address. I want the AJAX Post data (Preferably written, though I did not know how to do this, so ugly
data:
in & amp; .ajax call) , Create a list and close the Refresh list dialog - never return "opening" in the initial standard view before opening the list. Create a partial view:
& lt; Input type = "submit" value = "create" onclick = "createaddress (& lt;% = ViewData [" profile id "]%>;); Return;" / & Gt;
list partial view
& lt; Script type = "text / javascript" & gt; Function createaddress (id) {$ .ajax ({type: "POST", url: "/ address / create /" + ID, data: "address1 =" + document.getElementById ('Address1'). Val () + " & Amp; address2 = "+ document.getElementById ('Address2'). Val () +" and city = "+ document.getElementById ('city'). Val () +" & state = "+ document.getElementById ( 'State'). Val () + "and zip =" + document.getElementById ('zip'). Val () + "& amp; zipplus =" + document.getElementById ('zipplus'). Val (), success : Function (msg) {$ ("# dialog-create-address") dialog ('off');}}); } & Lt; / Script & gt;
I do not have enough jQuery UI Dialog codes to do, and I think its post includes standard ideas where I'm using partial ideas - but I Using its ModalViewEngine class. / P>
In addition, a jQuery UI dialog gives clicks clicked on the ones generated with the old values in my text box - how can I reset it? Try placing a quote around the vendetta:
Lt; Input type = "submit" value = "create" onclick = "createaddress ('& lt;% = ViewData [" profile id "]%> gt;'); return back;" / & gt;
Or even more unimpressed:
& lt;% use (HTML.biz form ("create", "address", new { ID = ViewData ["ProfileID"]}, FormMethod.Post, new {id = "theForm"})) {%> & Lt ;! - Some input fields - & gt; & Lt; Input type = "submit" value = "create" /> & Lt;%}% & gt;
and then submit the form event:
$ (function () {$ ('# theform'). Submit (function () { $ .ajax ({type: this.method, url: this.action, data: $ (this). Serialize (), success: function (msg) {$ ("# dialog-create-address") dialog ('off' ');}}); Return false;});});
Comments
Post a Comment