javascript - submit form inside div, not working with IE8 when submitting with ENTER -


i have form ( login, registration, whatever ) inside div.

the div has visibility: hidden , gets visibility:visible through javascript.

in ie8, when user completes form ( username, password ) , uses enter key press submit it, won't work ( work if presses login button ).

html:

<body onload="show_login();"> <div id="login" class="login_div"> <form id="form_login" method="post" action="index.php"> <input name="email" id="email" type="text" maxlength="100" size="30" /> <input name="password" id="password" type="password" maxlength="100" size="30" /> <input name="fromsubmit" id="fromsubmit" type="hidden" value="fromsubmit"/> <button id="blogin" type="submit"><span id="slogin">log in</span></button> </form> </div> </body> 

css:

.login_div {     visibility: hidden; } 

js:

function show_login() {     document.getelementbyid("login").style.visibility = "visible"; } 

maybe has come across problem before ?

any way solve without affecting js logic ?

edit

if remove doctype work, don't want remove it.

<!doctype html public "-//w3c//dtd xhtml 1.0 strict//en" "http://www.w3.org/tr/xhtml1/dtd/xhtml1-strict.dtd"> 


Popular posts from this blog

How to calculate SNR of signals in MATLAB? -

c# - Attempting to upload to FTP: System.Net.WebException: System error -

ios - UISlider customization: how to properly add shadow to custom knob image -