0

Enable autocomplete in form

asked 2013-05-20 10:27:58 +0800

AndreiTM gravatar image AndreiTM
1

updated 2013-05-20 17:21:23 +0800

Hello,

I'm struggling with the following scenario:

I have a login screen, where I need to remember the username and password. To do this, I wrapped the login elements inside a Form component and inject a fake submit via Javascript when the user clicks the Login button. Hence the browser interprets it as a submit and offers to save the password. See webmasterworld.com/javascript/4532397.htm for reference.

This approach worked like a charm with ZK 3.6 for all browsers, but it fails to work properly with Firefox as of ZK 6.5 (it's fine in IE). Firefox detects the submit and offers to save my password, but then fails to autocomplete it on the second login.

I made sure that all my "Remember passwords" and autocomplete options are on, and tried different fixes, like setting names for everything, even the autocomplete="on", but I still haven't managed to make it work in Firefox on the new version. The form and all my components are generated via Java form backend data, so there's no zul sample I can provide.

Do you know how to fix this?

Were there any changes in the framework (from 3.6) that may have had an impact on this?

EDIT

After reading several articles and dev forums on the Mozilla webpage, I came across the following information: apparently the Firefox password manager only sweeps the forms during page load. I then noticed the behavior differences between ZK 3.6 and ZK 6.5. In ZK 6.5, the first thing displayed on the page is the loading indicator, so Firefox may be interpreting that as the initial page. Can you detail the page loading differences between ZK 3.6 and 6.5? Maybe the answer lies somewhere in that general direction.

delete flag offensive retag edit

1 Answer

Sort by » oldest newest most voted
0

answered 2013-06-27 10:25:31 +0800

benbai gravatar image benbai
2228 6
http://www.zkoss.org

The code below works well for me (ZK 6.5.2, FF20), test steps:

  1. Input something in textbox then click submit button
  2. Input what you just inputed, autocomplete will triggered

    <zk xmlns:n="native"> <n:form> <textbox/> <button type="submit" label="submit"/> </n:form> </zk>

link publish delete flag offensive edit
Your answer
Please start posting your answer anonymously - your answer will be saved within the current session and published after you log in or create a new account. Please try to give a substantial answer, for discussions, please use comments and please do remember to vote (after you log in)!

[hide preview]

Question tools

Follow
1 follower

RSS

Stats

Asked: 2013-05-20 10:27:58 +0800

Seen: 44 times

Last updated: Jun 27 '13

Support Options
  • Email Support
  • Training
  • Consulting
  • Outsourcing
Learn More