简体   繁体   English

为什么chrome不识别此登录表单?

[英]why doesn't chrome recognize this login form?

I'm using the following login form in my web app. 我在我的网络应用程序中使用以下登录表单。 It works fine in IE7, FF3.6 and Chrome7.0. 它在IE7,FF3.6和Chrome7.0中运行良好。 Except for the fact that Chrome does not seem to recognize this form as a login form and therefore does not offer me to save the username/password. 除了Chrome似乎没有将此表单识别为登录表单,因此不提供我保存用户名/密码。 Both FF and IE do offer me to remember the username/password. FF和IE确实让我记住用户名/密码。

Here's the form: 这是表格:

<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 --> 

EDIT: I use jquery (not consistently as you can see), qTip (to show any login errors) and Xajax (as ajax framework). 编辑:我使用jquery(不一致,你可以看到),qTip(显示任何登录错误)和Xajax(作为ajax框架)。 The handleFunction is as follows: 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 });
}

Thanks for any advise! 谢谢你的任何建议!

By the way: I checked if my host is in the saved password exceptions list of Chrome. 顺便说一下:我检查了我的主机是否在Chrome的保存密码例外列表中。 It is not. 它不是。

I believe it is because the form is not actually being "submitted". 我认为这是因为表格实际上并未“提交”。 If you check the onsubmit attribute, you can see that it returns false at the end, which cancels the submission. 如果检查onsubmit属性,则可以看到它在结尾处返回false,这将取消提交。

You have to submit form twice: 你必须提交两次表格:

  1. one with JS validation 一个用JS验证
  2. and after that plain POST form. 然后在那个普通的POST表格之后。

Here is the solution 这是解决方案

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM