Note that there are some explanatory texts on larger screens.

plurals
  1. POHow can I stop classic-asp page from submitting form when the user presses enter in IE8?
    primarykey
    data
    text
    <p>I've got an ASP-classic page coming along, and there's a login dialog (made using jquery). The user clicks login, and the dialog pops up and asks for a password (no username needed. Small group). If they enter their password and physically click login, everything works fine. </p> <p>However, if they hit enter, somehow, the "form" submits, even though there is no form, and the url updates to <code>http://xxx.xxxx.xxxx.asp?password=whatever</code> and my login code doesn't execute (because the login button wasn't clicked). Weirdly enough, I just found that if the user goes to <code>http://xxx.xxxx.xxxx.asp?</code> instead of <code>http://xxx.xxxx.xxxx.asp</code> (note the question mark at the end), hitting enter inside the dialog doesn't do anything.</p> <p>Any idea why this happens and how I can stop it?</p> <p>EDIT: Here's the HTML for the dialog:</p> <pre><code>&lt;div id="login-form" title="Log in"&gt; &lt;p class="validateTips"&gt;Please enter your password.&lt;/p&gt; &lt;label for="password"&gt;Password&lt;/label&gt; &lt;input type="password" name="password" id="password" value="" class="text ui-widget-content ui-corner-all" /&gt; &lt;/div&gt; </code></pre> <p>and here's the jquery for it:</p> <pre><code>$( "#login-form" ).dialog({ autoOpen: false, height: 350, width: 350, modal: true, buttons: { "Log In": function() { var bValid = true; allFields.removeClass( "ui-state-error" ); if ( password.val() == 'skeet' ) { setCookie("loggedIn","true",1); alert("Logged in"); $( this ).dialog( "close" ); location.reload(); } else { alert("Invalid Password"); } }, Cancel: function() { $( this ).dialog( "close" ); } }, close: function() { allFields.val( "" ).removeClass( "ui-state-error" ); } }); </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.
 

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