Note that there are some explanatory texts on larger screens.

plurals
  1. POJavascript 'confirm()' Cancelling Post Back
    primarykey
    data
    text
    <p>On an asp.net 3.5 page, I have multiple textboxes that fire async postbacks on the TextChanged event as the user progresses through the form. After the user completes the form a "Submit" button is pressed to submit the form which contains a javascript "confirm" dialog. Everything works fine as long as the user has TABBED off all the fields. However if a user changes the value of one of the textboxes and clicks the button w/o exiting the textbox, the "onClientClick" fires but if there's a "confirm" specificed the page does not postback:</p> <pre><code>onClientClick = return confirm('Are you sure you want to submit?'); //Page Does Not Post </code></pre> <p>However removing the confirm on the page does postback:</p> <pre><code>onClientClick = return true; //Page Posts </code></pre> <p>The button is a <code>&lt;asp:PostBackTrigger/&gt;</code>. the textboxes' <code>&lt;asp:AsyncPostBackTrigger/&gt;</code>s are in the same updatepanel as the button. I've tried moving them to another updatepanel as well w/ the same result.</p> <p>Again, this is ONLY if the user has made a change in the textbox and does NOT tab off before clicking the button. Tabbing off the box works just fine. I've even put code to wait 5 seconds before displaying the confirm then submitting the form but same result (except having to wait 5 secs before confirming):</p> <pre><code>var dt = new Date(); dt.setTime(dt.getTime() + 5000); while (new Date().getTime() &lt; dt.getTime()); return confirm('Are you sure you want to submit?'); </code></pre> <p>Any ideas or decent workarounds??</p> <p>Thank you in advance!</p>
    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.
 

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