feeCombo.onItemSelectedChanged = function(value, index) {
if ( value ) {
if( myFeesClrs[index] == "noshow" ) {
alert("ERROR: You cannot select a red item. This fee is not assessable at this location.");
// what next?
}
document.getElementById("LocFeeCode").value = myFeesKeys[index];
}
else {
prevIdx = index;
}
};
// Note: onItemSelectedChanging fires twice on change:
// once with <value> = false where index is old selection
// and once with <value> = true where index is new selection
var prevIdx = -1;
feeCombo.onItemSelectedChanging = function(value, index) {
if ( value ) {
if( myFeesClrs[index] == "noshow" ) {
alert( "ERROR: You cannot select a red item. This fee is not assessable at this location." );
this.setCurrentItem( prevIdx );
this.setCurrentValue( myFeesVals[prevIdx] );
return 1; // using non-zero as error in AW; not sure if this is necessary or observed
}
document.getElementById("LocFeeCode").value = myFeesKeys[index];
}
else {
prevIdx = index;
}
};
This topic is archived.