Note that there are some explanatory texts on larger screens.

plurals
  1. POJquery Ajax NyroModal Page Reload after Succes
    primarykey
    data
    text
    <p>I have site running Jquery, Ajax, PHP, and an HTML form. It uses two pages. </p> <p>Pages...</p> <p>Example.php &amp; Processexample.php</p> <p>When you click the edit button on example.php a form pops up in the NyroModal window posting to Processexample.php and allows you to edit customer data that's posted using Ajax. </p> <p>After user clicks save on Porcessexample.php a SQL update is made and a success message is posted back to the Modal Box (end-user).</p> <p>Here are the issues...</p> <ol> <li>I can't get the NyroModal window to close after (data) success is called on processexample.php. I tried setting the Timeout in JQ/Javascript below but error occurs.</li> </ol> <p><strong>setTimeout("$.nyroModal.close()", 4000);</strong></p> <ol> <li>How do i get example.php page to display updated data automatically, or have the page reload after #send button is clicked and success is displayed in modal window.</li> </ol> <p><strong>HTML Form Code on processexample.php</strong></p> <pre><code>&lt;form id="AjaxForm" name="AjaxForm" action="#" method="post"&gt; &lt;input name="submitform" type="hidden" value="1" &lt;button id="send"&gt;Save Client&lt;/button&gt; </code></pre> <p><strong>JS Code on processexample.php</strong> --> See bold text in code where issue is. </p> <pre><code> $(document).ready(function() { $("#AjaxForm").submit(function() { return false; }); $("#send").on("click", function(e){ var idval = $("#client").val(); var calval = $("#view").val(); var emailval = $("#customer_email").val(); var nameval = $("#customer_name").val(); var phoneval = $("#customer_phone").val(); var msgval = $("#customer_note").val(); var msglen = msgval.length; var mailvalid = validateEmail(emailval); if(mailvalid == true &amp;&amp; msglen &gt;= 4) { // if both validate we attempt to send the e-mail // first we hide the submit btn so the user doesnt click twice $("#send").replaceWith("&lt;em&gt;sending...&lt;/em&gt;"); $.ajax({ type: 'POST', url: 'saveclient.php', data: $("#AjaxForm").serialize(), success: function(data) { if(data == "true") { $("#AjaxForm").fadeOut("fast", function(){ $(this).before("&lt;p&gt;&lt;strong&gt;Success! Your information has been updated.&lt;/strong&gt;&lt;/p&gt;"); **setTimeout("$.nyroModal.close()", 4000);** }); } } }); } }); }); &lt;/script&gt; </code></pre>
    singulars
    1. This table or related slice is empty.
    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.
    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