Note that there are some explanatory texts on larger screens.

plurals
  1. POModal dialog box not working correctly on submit - page posting back to itself
    primarykey
    data
    text
    <p>I've asked this question before and so the other post may be closed. But, I didn't get the full correct answer, something always seem to be missing in the code. I need to submit an email, get a modal box (with a confirm msg), have the modal fade out after 3 seconds, and upon successful submission, another page is loaded. </p> <p>Basically, the modal box is fading too fast. I want to slow it down. I've been advised to remove the </p> <pre><code>&lt;/form&gt;&lt;form&gt; </code></pre> <p>tags. Although the modal does slow down when I remove those tags, now I don't get the "welcome" page after submission. The page just seems to post back to itself instead of submitting. I've been trying to work this for five days, I have no idea what I'm doing wrong... I appreciate all answers. Thanks.</p> <p>Here is my code:</p> <pre><code>&lt;html&gt; &lt;head&gt; &lt;META http-equiv="Content-Type" content="text/html; charset=UTF-8"&gt; &lt;title&gt;&lt;/title&gt; &lt;script src="http://ajax.googleapis.com/ajax/libs/jquery/1.6.2/jquery.min.js"&gt;&lt;/script&gt; &lt;script src="http://ajax.googleapis.com/ajax/libs/jqueryui/1.8/jquery-ui.min.js"&gt; &lt;/script&gt; &lt;script src="http://recp.rm04.net//ui/library/formValidate.js" language="javascript"&gt; &lt;/script&gt; &lt;link href="http://ajax.googleapis.com/ajax/libs/jqueryui/1.8/themes/ui- lightness/jquery-ui.css" rel="stylesheet" type="text/css"&gt; &lt;STYLE TYPE="text/css"&gt; BODY, .BODY, TD { color: ; font-size: ; font-family: ; font-weight: ; text-decoration: ; font-style: ; } &lt;/STYLE&gt; &lt;/head&gt; &lt;body vlink="" alink="" link="" bgcolor=""&gt; &lt;!-- demo --&gt; &lt;div class="demo"&gt; &lt;div id="dialog" title="Basic dialog"&gt; &lt;p&gt;Email submitted successfully. Thank you for signing up!&lt;/p&gt; &lt;/div&gt; &lt;/div&gt; &lt;!-- End demo --&gt; &lt;br&gt; &lt;br&gt; &lt;table border="0" cellspacing="0" cellpadding="5"&gt; &lt;form name="form" method="post" action="http://links.mkt41.net/servlet/UserSignUp? f=755449&amp;postMethod=HTML&amp;m=0&amp;j=MAS2"&gt; &lt;tr&gt; &lt;td valign="top"&gt;&lt;span style="color:#CC0000"&gt;*&lt;/span&gt;&lt;/td&gt;&lt;td valign="top" align="left"&gt;Email:&lt;/td&gt; &lt;td&gt;&lt;input type="hidden" name="EMAIL_REQUIRED" value="T"&gt;&lt;input type="hidden" name="EMAIL_DATATYPE" value="email"&gt;&lt;input type="text" name="EMAIL" value="" maxlength="4000"&gt;&lt;/td&gt; &lt;/tr&gt; &lt;/form&gt; &lt;form&gt; &lt;tr&gt; &lt;td align="center" colspan="3"&gt; &lt;div id="opener"&gt; &lt;input type="button" name="submit" value="Submit" onClick="f_validateForm()"&gt;&lt;/div&gt; &lt;script src="js/modal_e-confirm.js" language="javascript"&gt;&lt;/script&gt; &lt;/td&gt; &lt;/tr&gt; &lt;/form&gt; &lt;/table&gt; &lt;p&gt; &lt;/p&gt; &lt;script&gt;f_initializeForm();&lt;/script&gt; &lt;/body&gt; &lt;/html&gt; </code></pre> <p>Here is the jQuery that I had help with from Rusty Jeans here at SO.</p> <pre><code>$('form').submit(function (e) { e.preventDefault(); $.post('http://links.net/servlet/UserSignUp? f=755449&amp;postMethod=HTML&amp;m=0&amp;j=MAS2&amp;EMAIL_REQUIRED=T&amp;EMAIL_DATATYPE=email', { EMAIL: $('input[name=EMAIL]').val() }, function (data) { $( "#dialog" ).dialog( "open" ); }); }); $( "#dialog" ).dialog({ autoOpen: false, show: "fade", hide: "fade", open: function(event, ui) { var dlg = $(this); setTimeout(function(){ dlg.dialog("close"); }, 3000); }, modal: true, opacity: 1 }); </code></pre>
    singulars
    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.
    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