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.
|
|
|
|
|
![]() |
||
Disabling a dynamic drop-down with JavaScript
|
||
| Notices |
![]() |
|
|
LinkBack | Thread Tools |
|
|||
|
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. |
|
|
![]() |
| Tags |
| disabling, dynamic, dropdown, javascript |
| Thread Tools | |
|
|
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 |