The code below works well in IE, it even works in firefox. But when I put this same JS on my actual page it will not work. I want to fix the errors and see if that helps. Here is the code:
<html> <head> <title></title>
<script language=”JavaScript” type=”text/javascript”>
function DoSilk(x){
if (1<=x && x<=20) y=(0.0524*x*x)+(32.04575);
if (20<x && x<=50) y=39.779
if (50<x && x<=288) y=(10.4835 * Math.pow(x, -0.121635))+.2;
if (288<x && x<=4200) y=(10.4835
if (4200<x) y=4;
}
function DoHeat(x){
if (1<=x && x<=100) y=(10.87*Math.pow(x,-.17))+1.03;
if (100<x) y=6;
}
function Radio(obj){
y=’?’;
x=document.forms.formjunk.product_options_amountzz.value;
rbs=obj.getElementsByTagName(‘INPUT’);
if (rbs[0].checked){
DoSilk(x);
}
if (rbs[1].checked){
DoHeat(x);
}
if (rbs[2].checked){
y=4;
}
document.getElementById(‘price’).value=y;
document.forms.orderform_16180.subtotal.value = (document.forms.orderform_16180.price.value
}
</script>
</head> <body>
<P>Quantity</P>
<FORM name=”formjunk” method=”post” action=””>
<INPUT type=”text” name=”product_options_amountzz” onBlur=”Radio(radioFred)”>
</form>
<P>
<FORM name=”form15″ method=”post” action=””>
<span id=”radioFred” onclick=”Radio(this);” >
Silk Screen<input type=”radio” name=”radioFred”> <br>
Heat Transfer<input type=”radio” name=”radioFred”><br>
Blank<input type=”radio” name=”radioFred”> <br>
</span>
</form>
<FORM name=”orderform_16180″ method=”post” action=””>
Price Per<input id=”price” size=”10″> <br>subtotal<input id=”subtotal” size=”10″>
</FORM>
</body>
</html>
I get the following errors: radioFred is not defined. document.getElementById(“price”) has no properties. I’m not sure if this is part of the problem on my actual page, but I can’t think of anything else. I’ve been reading on the web about these problems being created by local/global issues. What do I have to do to get rid of these errors?