Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p>Not sure which page you want to scroll to the top. The dialog box, the page the dialog box is on, or the page that is in the iframe?</p> <p><strong>After looking at your code I believe this is the one you are after:</strong></p> <p>If the dialog has a scrollable element that is already scrolled down after the iframe changes, then you will want to target whatever element has "overflow: auto". If that element is #dialog then do this on the iframe page the form is in (which in your case looks to be form.php):</p> <pre><code>&lt;script type="text/javascript"&gt; $(function(){ $("#orderform").submit(function() {//note: in jquery the onsubmit event is called "submit" $('#dialog', window.parent.document).scrollTop(0);//target #dialog from the parent window alert('triggered'); }); }); &lt;/script&gt; </code></pre> <p><strong>Other possible solutions for reference for others:</strong></p> <p>If its the page the dialog is on then do the following:</p> <p>If the form is in the iframe then the code needs to be in the iframe. You will then need to modify the code to target the parent window.</p> <p>This should be what you are looking for:</p> <pre><code>&lt;script type="text/javascript"&gt; $("#orderform").submit(function() { $(window.parent).scrollTop(0); alert('triggered'); }); &lt;/script&gt; </code></pre> <p>If the page you want to scroll is the thank you page or the error page then put the following on the thank you and error pages: (you will need jquery on the thank you and error pages)</p> <pre><code>&lt;script type="text/javascript"&gt; $(function(){ $(window).scrollTop(0); }); &lt;/script&gt; </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. VO
      singulars
      1. This table or related slice is empty.
    2. VO
      singulars
      1. This table or related slice is empty.
    3. VO
      singulars
      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