Hi all.
Upon deciding current browsers CSS implementation didn't allow select boxes to look as spiffy as i wanted... i wrote this little script which acts like a select box (sort of) but isn't.
Anywho it works Grreeaat in Mozilla.
IE always gives me heaps of trouble, because it hates me and tries to kill me daily.
If ya'll can figure out why this is giving me problems I'd appreciate any help. Thanks.
Here's a link to it to see it live -->
and here's dee code, the part that counts anyway :
hope that worked... Thanks.
Upon deciding current browsers CSS implementation didn't allow select boxes to look as spiffy as i wanted... i wrote this little script which acts like a select box (sort of) but isn't.
Anywho it works Grreeaat in Mozilla.
IE always gives me heaps of trouble, because it hates me and tries to kill me daily.
If ya'll can figure out why this is giving me problems I'd appreciate any help. Thanks.
Here's a link to it to see it live -->
and here's dee code, the part that counts anyway :
Code:
<script type="text/javascript">
function altSelect(nAme,iD,num) {
var meType = "type" + num;
var select = "select" + num;
var defBg = "#FFF";
var selectBg = "#0A246A";
if(nAme == meType)
return;
optionArr = document.getElementsByName(meType);
if(optionArr.length != 0) {
option = optionArr.item(0);
option.name = select;
}
optionArr = document.getElementsByName(nAme);
for(var i=0;i<optionArr.length;i++) {
option = optionArr.item(i);
option.style.backgroundColor = defBg;
option.style.color = "#000";
}
option = document.getElementById(iD);
option.name = meType;
option.style.backgroundColor = selectBg;
option.style.color = "#FFF";
}
function chgName(poop) {
blah = document.getElementById(poop);
blah.name = "select1";
}
</script>
</head>
<body>
<form action="vardump.php" method="get">
<div id="select">
<input name="select1" id="gold1" type="text" readonly="readonly" value="Gold" onfocus="altSelect(this.name,this.id,1);" />
<input name="select1" id="silv1" type="text" readonly="readonly" value="Silver" onfocus="altSelect(this.name,this.id,1);" />
<input name="select1" id="plat1" type="text" readonly="readonly" value="Platinum" onfocus="altSelect(this.name,this.id,1);" />
<input name="select1" id="pall1" type="text" readonly="readonly" value="Palladium" onfocus="altSelect(this.name,this.id,1);" />
</div>
<input type="submit" value="submit" />
</form>
hope that worked... Thanks.