Disabling a dynamic drop-down with JavaScript

This is a discussion on "Disabling a dynamic drop-down with JavaScript" within the JavaScript Forum section. This forum, and the thread "Disabling a dynamic drop-down with JavaScript are both part of the Program Your Website category.



Go Back   Webforumz.com > Main Forums > Program Your Website > JavaScript Forum

Notices


Reply
 
LinkBack Thread Tools
  #1 (permalink)  
Old Mar 6th, 2006, 13:23
Junior Member
Join Date: May 2005
Location: Virginia US
Age: 30
Posts: 26
Thanks: 0
Thanked 0 Times in 0 Posts
Question Disabling a dynamic drop-down with JavaScript

In a JSP page I am trying to disable a Trade Class drop-down list if the user does not select the ADULT option of the Division drop-down list.

Therefore, Trade Class drop-down list availability depends on the option selected in the Division drop-down list. For instance, if the user selects the KIDS division option then the Trade Class drop-down list should be disable.

I am trying to use JavaScript to do this but I can't get it to work.
I have the OnClick attribute in the Division drop-down list so that when a user selects any option from the list the index gets past to the JavaScript function. In my drop-down Division ADULT has index 1. see below

function enableDisableTradeClass( ) {
var index = document.frm_container_shipments.drp_division_fltr .selectedIndex;
//alert('Selected Division= ' + index);
if ( index != 1 ) {
document.frm_steps.drp_trade_class_fltr.value = "";
document.frm_steps.drp_trade_class_fltr.selectedIn dex = 0;
}
}

Please advise, thanks.
Reply With Quote

Reply

Tags
disabling, dynamic, dropdown, javascript

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On

Similar Threads
Thread Thread Starter Forum Replies Last Post
(javascript)dynamic value to variable in src alexrozario JavaScript Forum 0 Jul 13th, 2007 07:02
Drop Down Menu not Working Since I added Toggle Javascript to Page davva JavaScript Forum 1 May 19th, 2006 15:03
problem with css/javascript drop down menu ultimate0 Web Page Design 9 Mar 29th, 2006 14:15
CSS and Javascript Drop down menu barrysmith JavaScript Forum 2 Jul 20th, 2005 12:35
How can I search a drop-down list using JavaScript in IE gecastill JavaScript Forum 9 May 31st, 2005 19:33


All times are GMT. The time now is 10:43.


Powered by vBulletin®
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Search Engine Friendly URLs by vBSEO 3.2.0 RC8
© 2003-2008 Webforumz.com : All Rights Reserved

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43