This week's book giveaways are in the Refactoring and Agile forums.
We're giving away four copies each of Re-engineering Legacy Software and Docker in Action and have the authors on-line!
See this thread and this one for details.
Win a copy of Re-engineering Legacy Software this week in the Refactoring forum
or Docker in Action in the Cloud/Virtualization forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

onselect / onchange ????

 
Frank Jacobsen
Ranch Hand
Posts: 358
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
This code works, but if i replace the onchange with onselect, it dosent work, any good ideas ???




Frank
 
Bear Bibeault
Author and ninkuma
Marshal
Pie
Posts: 64631
86
IntelliJ IDE Java jQuery Mac Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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?
 
Eric Pascarello
author
Rancher
Posts: 15385
6
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 358
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 15385
6
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
onblur fires every time

Eric
 
Frank Jacobsen
Ranch Hand
Posts: 358
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 15385
6
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic