Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chris Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Help with script

Status
Not open for further replies.

walterja

IS-IT--Management
May 25, 2007
6
US
Why doesn't this simple script work?
when individual dealer is selected, it works fine with the 2 list boxes disabled, but when i switch back to all dealers, only out of compliance or brand it won't enable them back. it does enable the profit center back. Please help! thanks


<script>
function disable(newVal)
{
if (newVal == "All Dealers" || newVal == "Only Out of Compliance" || newVal == "Brand")
{ rdForm.ProfitCenter.disabled=true;}
{ rdForm.TerminalCity.disabled=false;}
{ rdForm.Brand.disabled=false;}
if (newVal == "Individual Dealer")
{ rdForm.ProfitCenter.disabled=false;}
{ rdForm.TerminalCity.disabled=true;}
{ rdForm.Brand.disabled=true;}
}
</script>
 
Your braces are messed up. Try this:

Code:
if (newVal == 'All Dealers' || newVal == 'Only Out of Compliance' || newVal == 'Brand') {
	rdForm.ProfitCenter.disabled = true;
	rdForm.TerminalCity.disabled = false;
	rdForm.Brand.disabled = false;
}

if (newVal == 'Individual Dealer') {
	rdForm.ProfitCenter.disabled = false;
	rdForm.TerminalCity.disabled = true;
	rdForm.Brand.disabled = true;
}

Hope this helps,
Dan

Coedit Limited - Delivering standards compliant, accessible web solutions

[tt]Dan's Page [blue]@[/blue] Code Couch
[/tt]
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top