Simple user authentication and helpful browsers
I am building on a standard form driven user login panel. Works well enough. All browsers recognize the pattern as a login panel and helpfully offer to store passwords. The way the user login information is then later recalled varies by browser. I focus here on FF, but the problem is universal.
Like any standard form, my login form comprises basic INPUT tags. W3C says that INPUT tags should fire ONCHANGE only ONBLUR. If I wanted to drive an OK (submit) button, say, that was disabled until some information was entered into my form, then W3C standard-compliance means that my OK button does开发者_JAVA技巧 not become enabled until the user clicks away from the field. I don't much like this behaviour and throughout my app, my INPUT tags are backed by JS code that fires ONCHANGE the moment a modifier key goes down. That's all dandy. However...
When FF recognizes my login form, it suggests to recall my login information. When I accept, FF helpfully fills in the two fields and ... my OK button remains disabled (because my keyboard driver, which detects the modifier keys and fires the ONCHANGE event, remains unaware of the form change; FF has pasted the information into the field without the use of the keyboard buffer).
Has anyone come across this problem before and discovered what event browsers fire when information appears "out of nowhere" in an INPUT field?
Thanks.
You're not the first, see: Trigger javascript event when using Google auto fill on firefox which suggests http://www.w3.org/TR/DOM-Level-2-Events/events.html#Events-eventgroupings-mutationevents
精彩评论