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.