Current location: Hot Scripts Forums » General Web Coding » JavaScript » Event for Form History Drop Box


Event for Form History Drop Box

Reply
  #1 (permalink)  
Old 03-16-09, 10:55 AM
Ryan75 Ryan75 is offline
Newbie Coder
 
Join Date: Jan 2009
Posts: 15
Thanks: 1
Thanked 0 Times in 0 Posts
Event for Form History Drop Box

When users come to a login page, many times if they click in a form box (ex. username), they will get a browser dropdown history box of the data previously typed.

The problem I'm running into is if a user just types in their username, the javascript code (onkeyup) runs and my login button activates. if that user clicks on a name in the history dropbox, the javascript code doesn't execute and the login button stays grayed out. The user has to type at least one thing in the box to run the script.

I've checked blured, but then with that, the user basically has to click somewhere on the window first to activate the button, which looks silly to me.

Is there an event that runs when a user selects an item from the history drop box?

I've tried, onclick, onblur, onchange, onkeyup already.
Reply With Quote
  #2 (permalink)  
Old 03-16-09, 03:03 PM
dgreenhouse's Avatar
dgreenhouse dgreenhouse is offline
Aspiring Coder
 
Join Date: Mar 2009
Location: San Francisco
Posts: 457
Thanks: 0
Thanked 3 Times in 3 Posts
Yep, that's a hard one.

Don't know if you'll be able to solve that since it's the browser that's remembering the
name of the input element from previously saved values.

It could possibly be done in FireFox; and others, but you'd have no control over the
internals of the user's browser (except in a corporate environment); so that's moot!

I think you'll have to inform the user in some way (via text) that they'll need to use
the tab or enter key after selecting a value from the history drop down.

Something like (when onfocus() fires, add similar text near the element):
"Press 'Tab' or 'Enter' after entering your username"

When the JavaScript runs after the user enters information
(onkeyup(), onchange() or {tab or enter}), you could remove the help text from the
screen. If it doesn't fire, the text is there to remind them of what to do.

Wow! Who would've thought we'd be back to the old days.
Reply With Quote
Reply

Bookmarks


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
update mysql with drop down box pieteke PHP 2 05-25-06 01:18 PM
Query in drop box Hunter PHP 3 05-22-06 02:23 PM
populate a drop down box minority ASP 3 06-28-05 10:12 AM
change drop down box based on textbox talax JavaScript 1 02-24-05 07:38 AM


All times are GMT -5. The time now is 11:46 PM.
vBulletin® Copyright ©2000 - 2012, Jelsoft Enterprises Ltd.