Wrox Programmer Forums
Go Back   Wrox Programmer Forums > Web Programming > JavaScript > Javascript How-To
Javascript How-To Ask your "How do I do this with Javascript?" questions here.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the Javascript How-To 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
Old January 6th, 2005, 01:47 PM
Registered User
Join Date: Jan 2005
Posts: 9
Thanks: 0
Thanked 0 Times in 0 Posts
Default postback issue with drop downlists with javascript

I have a problem with which I am struggling for many days.
I have a page which has six drop down list (which are webform elements and not html elements). Auto postback property is enabled for all the elements. The data in the dropdown lists are related in a hierarical fashion. Now to give you the general idea of the working of the page, suppose, When the client changes the selection in any of lists in the page (say list number 2), it updates the items of the subsequent lists (that is lists 3, 4, 5, 6). The process is database intensive, so it takes quite a while before any results comes up.
What I want is to prevent the client from changing the selection before their previous request is serviced, by disabling the dropdown lists in the page.
I am trying to use Javascript to disable the lists by adding a "OnChange" attribute to the dropdown list, in the Page_Load event of the page.
            ddllist1.Attributes.Add("OnChange", "disable();")
            ddllist2.Attributes.Add("OnChange", "disable();")
            ddllist6.Attributes.Add("OnChange", "disable();")
The disable function is defined on the <Head> of the aspx page. Now the trouble is, this "OnChange" event is suppressing the "OnSelectedIndexChanged" event of the dropdown lists!! So though the lists are getting disabled, when the client is changing the selection, the code in the "OnSelectedIndexChanged" is not executing and the lists are not getting updated.
Please suggest.

Old January 6th, 2005, 01:49 PM
richard.york's Avatar
Wrox Author
Join Date: Jun 2003
Posts: 1,706
Thanks: 0
Thanked 6 Times in 6 Posts

Cross-post with: http://p2p.wrox.com/topic.asp?TOPIC_ID=24523
Post replies there. Please don't cross-post.


Mail_IMAP: A PHP/C-Client/PEAR solution for webmail
Author: Beginning CSS: Cascading Style Sheets For Web Design

Similar Threads
Thread Thread Starter Forum Replies Last Post
ajax drop downlists msathyaprasad90 ASP.NET 1.0 and 1.1 Professional 1 June 28th, 2006 02:54 AM
drop down with large data on postback gives error madhusrp ASP.NET 1.0 and 1.1 Professional 5 March 16th, 2006 02:55 AM
postback issue with drop downlists emachines ADO.NET 3 March 26th, 2005 01:36 PM
postback issue with drop downlists with javascript emachines Javascript 3 January 24th, 2005 06:54 AM
postback issue with drop downlists emachines General .NET 1 January 9th, 2005 09:42 PM

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