jzp*_*p74 9 html forms google-chrome login
我在我的网络应用程序中使用以下登录表单.它在IE7,FF3.6和Chrome7.0中运行良好.除了Chrome似乎没有将此表单识别为登录表单,因此不提供我保存用户名/密码.FF和IE确实让我记住用户名/密码.
这是表格:
<form name="login_form" id="login_form" action="" method="POST" onsubmit="javascript:handleFunction('action_login', document.getElementById('user_name_id').value, document.getElementById('password_id').value); return false;">
<div class="login_line">name<input name="user_name" id="user_name_id" size="16" maxlength="16" value= "" type="text"></div>
<div class="login_line">password<input name="password" id="password_id" size="16" maxlength="16" type="password"></div>
<div class="login_line"><input type=submit class="icon icon_accept" value="login"></div>
</form> <!-- login_form -->
Run Code Online (Sandbox Code Playgroud)
编辑:我使用jquery(不一致,你可以看到),qTip(显示任何登录错误)和Xajax(作为ajax框架).handleFunction如下:
function handleFunction (functionName)
{
// remove any static qtip from screen
if ( $('#qtip_close_button').length )
{
// click on close button of qtip
$('#qtip_close_button').click();
}
// remove the first argument from the arguments list
var argArray = $.makeArray(arguments).slice(1);
xajax.request({ xjxfun : functionName }, { parameters : argArray });
}
Run Code Online (Sandbox Code Playgroud)
谢谢你的任何建议!
顺便说一下:我检查了我的主机是否在Chrome的保存密码例外列表中.它不是.
我相信这是因为该表格实际上并未被“提交”。如果检查 onsubmit 属性,可以看到它最后返回 false,这会取消提交。