Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
774 views
in Technique[技术] by (71.8m points)

html - 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. 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. Both FF and IE do offer me to remember the username/password.

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). The handleFunction is as follows:

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. It is not.

See Question&Answers more detail:os

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Reply

0 votes
by (71.8m points)

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.


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
OGeek|极客中国-欢迎来到极客的世界,一个免费开放的程序员编程交流平台!开放,进步,分享!让技术改变生活,让极客改变未来! Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...