Monday, June 3, 2024
 Popular · Latest · Hot · Upcoming
159
rated 0 times [  163] [ 4]  / answers: 1 / hits: 21523  / 15 Years ago, fri, november 20, 2009, 12:00:00

I have an ASP.NET dropdown list control with onclick and onchange JavaScript events.
Both work in IE, Mozilla, Opera and Chrome, but not in Safari. When I remove the onclick event, onchange suddenly works.



The reason I use onclick is to get the value of the dropdown list before it changes. Is there a way I can do that without using onclick? That is, get the value of the dropdown list before it changes/a new value is selected? I want to do this in JavaScript only.


More From » safari

 Answers
1

Replacing the onclick event with onfocus solved the problem. I guess Safari doesn't like onclick event on select elements.


[#98268] Tuesday, November 17, 2009, 15 Years  [reply] [flag answer]
Only authorized users can answer the question. Please sign in first, or register a free account.
sonja

Total Points: 541
Total Questions: 113
Total Answers: 114

Location: Anguilla
Member since Sun, Jan 29, 2023
1 Year ago
sonja questions
Mon, Nov 30, 20, 00:00, 4 Years ago
Sun, Oct 11, 20, 00:00, 4 Years ago
Thu, May 21, 20, 00:00, 4 Years ago
Sun, Nov 10, 19, 00:00, 5 Years ago
Mon, Aug 26, 19, 00:00, 5 Years ago
;