GeeCON Prague 2014*
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


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: 353
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: 61310
    
  66

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: 353
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: 353
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
 
GeeCON Prague 2014
 
subject: onselect / onchange ????