p2p.wrox.com Forums

p2p.wrox.com Forums (http://p2p.wrox.com/index.php)
-   Classic ASP Basics (http://p2p.wrox.com/forumdisplay.php?f=61)
-   -   Weird problem with dropdown onclick event in IE 7. (http://p2p.wrox.com/showthread.php?t=61849)

tovipul21 September 7th, 2007 04:38 AM

Weird problem with dropdown onclick event in IE 7.
I am facing very weird problem with dropdown onclick event in IE 7.0 for ASP 3.0 application

When page gets load, I fill a dropdown control from the database & while doing so I set the Text of the very 1st option as 'Use Drop Down to select value' (followed by values from the database)
<option name=' ' value=''>Use Drop Down or 'Find' to locate a skill</option>

I am calling the following function on onClick event of that dropdown & that function (ChangeText) empties the text of the 1st Option (i.e. it removes the 'Use Drop Down or 'Find' to locate a skill' text)

<select Name='Select1' id='Test1' onClick='ChangeText(this)' ...

function ChangeText(list)

After implementing the above logic when user clicks on the dropdown button (to select a value), the data dropdown menu disappears immediately, not allowing user to select any value. The dropdown data menu should stay open and allow user to select a value.

This works absolutely fine in other dropdowns where onClick event has not been implemented.

Also note that there is no such problem in IE 6.0. Donno why its behaving such a way with onClick event in IE 7.0.

I have implemented the above logic in my ASP 3.0 app

Thanx in advance

Vipul Mehta

Vipul Mehta
Sr. Software Developer
Accenture Services Pvt Ltd

sdi126 September 7th, 2007 01:15 PM

That is a very weird problem...not sure why that happens. I noticed if you replace the text with the exact same string instead of an empty string it stays open....but that doesn't help

You can use onmouseover instead of onclick though that should give the same effect your looking for


All times are GMT -4. The time now is 05:39 AM.

Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.