Note that there are some explanatory texts on larger screens.

plurals
  1. POjQuery modal form dialog postback problems
    primarykey
    data
    text
    <p>I've created a <a href="http://en.wikipedia.org/wiki/JQuery_UI" rel="nofollow noreferrer">jQuery UI</a> Modal form, and I want that form to trigger a postback, but I'm having difficulty getting it to work.</p> <p>I know there are quite a few articles based on using the SimpleModal plugin, and I have tried to adapt these and override the _doPostback function, but with no joy.</p> <p>I think the problem is within the call to my __doPostBack function and what the parameters should be. Is that the case?</p> <p>Here's my form</p> <pre><code>&lt;form id="summaryForm" runat="server"&gt; &lt;div id="dialog" title="Quick Booking"&gt; &lt;p&gt;Select user from list or enter name in box&lt;/p&gt; &lt;fieldset&gt; &lt;p&gt;&lt;label&gt;Is machine going out of the office?&lt;/label&gt;&lt;/p&gt; &lt;asp:RadioButton TextAlign="Left" GroupName="outOfOffice" Text="Yes" ID="optYes" class="radio" runat="server" /&gt; &lt;asp:RadioButton TextAlign="Left" GroupName="outOfOffice" Text="No" ID="optNo" class="radio" runat="server" Checked="true" /&gt; &lt;label for="dropLstUser"&gt;User:&lt;/label&gt; &lt;asp:DropDownList ID="dropLstUser" runat="server" /&gt; &lt;input type="text" name="txtUser" id="txtUser" value="" class="text" /&gt; &lt;label for="txtStartDate"&gt;Start Date:&lt;/label&gt; &lt;input type="text" id="txtStartDate" name="txtStartDate" class="datepicker" /&gt; &lt;asp:HiddenField ID="assetField" runat="server" /&gt; &lt;%--&lt;button onclick="performPostBack('summaryForm')"&gt;Postback&lt;/button&gt;--%&gt; &lt;/fieldset&gt; &lt;/div&gt; //-------------------------------- </code></pre> <p>Here is the JavaScript code:</p> <pre><code>&lt;script type="text/javascript"&gt; $(function() { $("#dialog").dialog({ bgiframe: true, height: 300, modal: true, buttons: { 'Close': function() { alert("closing"); $(this).dialog("close"); __doPostBack = newDoPostBack; __doPostBack("aspnetForm",null); } } }); }); function newDoPostBack(eventTarget, eventArgument) { alert("postingback"); var theForm = document.forms[0]; if (!theForm) { theForm = document.aspnetForm; } if (!theForm.onsubmit || (theForm.onsubmit() != false)) { document.getElementById("__EVENTTARGET").value = eventTarget; document.getElementById("__EVENTARGUMENT").value = eventArgument; theForm.submit(); } } &lt;/script&gt; </code></pre>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload