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!

Select menu problem 1

Status
Not open for further replies.
Dan,

I cannot remove label attributes as they are used in the script to dynamically swap dollar amounts in the first row of the table. Again, this worked fine in IE6.

I also tried to validate. Thanks for the tip on that.

FYI, I have recently inherited this site and am not a whiz at Javascript. I have pasted the script below in case anyone would like to look at it.

****************

<script type="text/javascript" language="JavaScript"><!--

function countyList() {

turnOffCounty();

var region = document.getElementById(county.options[county.selectedIndex].label);
var countyOption = document.getElementById(county.value);
var oCare = document.getElementById("oc");

countyOption.style.backgroundColor="#E4CFCF";

var bname = navigator.appName;
if (bname.search(/microsoft/i) == 0)
{
region.style.display="block";
countyOption.style.display = "block";
oCare.style.display = "block";
}
else
{
countyOption.style.display = "table-row";
region.style.display="table-row";
oCare.style.display = "table-row";
}
}

function turnOffCounty() {
var county = document.getElementById("county");
var elem;

for (i=0; i<county.length; i=i+1)
{
if (county.options.label != "")
{elem = document.getElementById(county.options.label);}
if (elem != null){
elem.style.display="none";
}

if (county.options.value != "")
{elem = document.getElementById(county.options.value);}
if (elem != null) {elem.style.display="none";}
}

}
//--></script>
 
You could use a lookup table to determine the dollar ammount based on the value selected. That would allow you to work fine in all browsers regardless of their 'quirkiness'.

Dan



Coedit Limited - Delivering standards compliant, accessible web solutions

[tt]Dan's Page [blue]@[/blue] Code Couch
[/tt]
 
Dan,

Not yet but, the lookup table seems like one way to fix it. I've been looking into it. While this problem is high on my list, right now I'm getting hit from all sides. I'll probably work on it this weekend.

Thanks for keeping in touch. I really appreciate it.

Henry
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top