This week's book giveaway is in the Servlets forum.
We're giving away four copies of Murach's Java Servlets and JSP and have Joel Murach on-line!
See this thread for details.
The moose likes HTML, CSS and JavaScript and the fly likes onselect / onchange ???? Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Murach's Java Servlets and JSP this week in the Servlets forum!
JavaRanch » Java Forums » Engineering » HTML, CSS and JavaScript
Bookmark "onselect / onchange ????" Watch "onselect / onchange ????" New topic
Author

onselect / onchange ????

Frank Jacobsen
Ranch Hand

Joined: May 17, 2002
Posts: 348
This code works, but if i replace the onchange with onselect, it dosent work, any good ideas ???




Frank
Bear Bibeault
Author and ninkuma
Marshal

Joined: Jan 10, 2002
Posts: 60752
    
  65

Not to be flip, but if it works with onchange, why try to change it?

Or are you really asking about the nuances between the two handler types?


[Asking smart questions] [Bear's FrontMan] [About Bear] [Books by Bear]
Eric Pascarello
author
Rancher

Joined: Nov 08, 2001
Posts: 15376
    
    6
onselect is an event, but not an event for a select element.

Read about the event handler here: http://www.devguru.com/Technologies/xhtml/quickref/xhtml_event_onselect.html

Eric
Frank Jacobsen
Ranch Hand

Joined: May 17, 2002
Posts: 348
Ok i cant use onselect in a drop down box, but how do i inplement the same functionality in a drop down, i dont want a onchange , but i want a onselect in a drop down ???

Is the only possibility javascript !

Frank
Eric Pascarello
author
Rancher

Joined: Nov 08, 2001
Posts: 15376
    
    6
onblur fires every time

Eric
Frank Jacobsen
Ranch Hand

Joined: May 17, 2002
Posts: 348
No onblur first take aktion when its loose focus, and that dont happens when i select a new item in my drop down box......

Any other ideas ???

Frank
Eric Pascarello
author
Rancher

Joined: Nov 08, 2001
Posts: 15376
    
    6
onchange fires when you select an item
onblur fires when you leave the item

those are the two events you have to work with.

Eric
 
It is sorta covered in the JavaRanch Style Guide.
 
subject: onselect / onchange ????
 
Similar Threads
display
problem with calling jsp page on evenet onSelect/onClick
toughie..JSP in Javascript Dynamic Drop Down List
Dynamic Drop Down Lists.
dynamic drop down menu, jsp