Wrox Programmer Forums
Go Back   Wrox Programmer Forums > ASP.NET and ASP > ASP 3 Classic ASP Active Server Pages 3.0 > Classic ASP Basics
| Search | Today's Posts | Mark Forums Read
Classic ASP Basics For beginner programmers starting with "classic" ASP 3, pre-".NET." NOT for ASP.NET 1.0, 1.1, or 2.0
Welcome to the p2p.wrox.com Forums.

You are currently viewing the Classic ASP Basics section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
  #1 (permalink)  
Old September 7th, 2007, 04:38 AM
Registered User
 
Join Date: Oct 2004
Location: Mumbai, Maharashtra, India.
Posts: 3
Thanks: 0
Thanked 0 Times in 0 Posts
Send a message via Yahoo to tovipul21
Default Weird problem with dropdown onclick event in IE 7.

Hi,
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)
Eg:
<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)

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

function ChangeText(list)
{
list.options[0].text=""
}


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

Regards,
Vipul Mehta

Vipul Mehta
Sr. Software Developer
Accenture Services Pvt Ltd
  #2 (permalink)  
Old September 7th, 2007, 01:15 PM
Authorized User
 
Join Date: Sep 2007
Location: , , .
Posts: 56
Thanks: 0
Thanked 1 Time in 1 Post
Default

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

http://mynameissteve.com


Similar Threads
Thread Thread Starter Forum Replies Last Post
dropdown menus OnClick Store To session variable, sionsolo42069 ASP.NET 2.0 Professional 1 March 31st, 2006 03:38 PM
onclick event bjackman Access 6 July 15th, 2004 06:54 AM
onclick event pigtail Javascript 1 April 11th, 2004 03:10 PM
onClick Event mateenmohd Javascript 4 December 16th, 2003 01:08 AM
onClick event problem mateenmohd Javascript 8 August 2nd, 2003 05:16 AM





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