javascript - login form do not recognize input password on chrome -
i'm trying modify code footer, , login form cannot recognize password on chrome.
code works ok on ie9.0, , ff28.0, opera, safari, not on chrome.
: "errors have occurred during of form! please make following corrections,
*the 'password' can not empty!'
please help!
// members $html .= '<div class="members">'; if( $_session['customer_id'] ){ $html .= '<div class="footer_title">'."customer login".'</div>'; $html .= '<div><a href="'.gf_href_link("process_cart.php",'','ssl'). '" >'. box_heading_shopping_cart .'</a></div>'; $html .= '<div><a href="'.gf_href_link("account.php",'','ssl'). '" >'. txt_my_account .'</a></div>'; $html .= '<div><a href="'.gf_href_link("logoff.php"). '" >'. txt_logout .'</a></div>'; $html .= '<div style="height:10px;"></div>'; } else { $html .= '<div class="footer_title" style="margin-bottom:5px;">'."customer login".'</div>'; $html .= '<form id="loginform" onsubmit="return check_login()" name="loginform" method="post" action="">'; $html .= '<div class="footer_email"><input class="email_input1" name="customer_name" type="text" value="'. txt_enter_email .'" onclick="if( this.value == '."'".txt_enter_email."'". ') this.value='."''".';"></div>'; $html .= '<div class="password_login1">'; $html .= '<div class="footer_password">'; /* script */ $html .= '<script type="text/javascript"> function show_password_input(){ $("#tx").hide(); $("#pw").show(); $("#pw").attr("value",""); $("#pw").focus(); } </script>'; $html .= '<input class="password_input1" name="customer_password" id="tx" type="text" value="'.txt_password.'" onfocus="show_password_input();">'; $html .= '<input class="password_input1" name="customer_password" id="pw" type="password" style="display:none;">'; $html .= '</div>'; $html .= '<div class="footer_login">'.gf_image_submit("btn_login.png","login", "class='login_btn1'"). '</div>'; $html .= '<div style="clear:both"></div>'; $html .= '</div>'; $html .= '</form>'; $html .= '<div style="clear:both;text-align:right;padding-right:10px;"><a href="'.gf_href_link("account.php"). '">register</div>'; } $html .= '</div>'; $html .= '<script language="javascript">'; $html .= '$(window).load(function(){ var left_height = $(".left").height(); var center_height = $(".center").height(); if( left_height <= center_height){ $(".left").attr({style:"height:"+(center_height-20)+"px"}); } });'; $html .= "\n"; $html .= 'var submitted = false; function check_login() { var error = 0; var doberror = 0; var error_message = "'.js_error.'"; if (submitted == true) { alert("'.js_error_submitted.'"); return false; } var email_address = document.loginform.customer_name.value; var customer_password = document.loginform.customer_password.value; if (document.loginform.elements["customer_name"].type != "hidden") { if(email_address == "" || email_address == "enter email address" || email_address.length < '.((cfg_customers_email_address)?cfg_customers_email_address:'0').') { error_message = error_message + "'.js_email_address.'"; error = 1; } else if(!validateemail(email_address)) { error_message = error_message + "* sorry, email address invalid!"; error = 1; } } if (document.loginform.elements["customer_password"].type != "hidden") { if(customer_password == "") { error_message = error_message + "* \'password\' can not empty! \r\n"; error = 1; } } if (error == 1) { alert(error_message); return false; } else { submitted = true; document.loginform.submit(); return true; } }'; $html .= '</script>'; $js='
you have 2 field name customer_password. when form submitted name of input field used name of argument kindly try changing name of hidden password field. can change name customer_password1 (for input id "tx")
Comments
Post a Comment