I’m new to Javascript and I can’t figure out why this is giving me an error. Is it about the code or something about the browser?
[QUOTE]
<body>
<font face=”Helvetica, Arial” size=”2″ color=”#000000″>
Season
<select name=”season” size=”1″ onChange=”calcweight()”>
<option selected >Ban season
<option >Post ban
</select><br>
</font>
<table border=”0″>
<font face=”Helvetica, Arial” size=”1″ color=”#000000″><strong>
<tr>
<td align=”top” width=”100″> Axle Group </td>
<td align=”top” width=”50″> Number of axles </td>
<td align=”top” width=”80″> Tire Capacity </td>
<td align=”top” width=”80″> weight </td>
</tr>
<tr>
</tr>
<tr>
<td>carriers</td>
<td> <select name=”axle” size=”1″ onChange=”calcweight()”>
<option selected >single
<option >tandem
</select> </td>
<td> </td>
<td> <input type=”text” name=”rated” value=”0000″ size=”8″ onKeyUp=”calcweight()” > </td>
<td> <input type=”text” name=”weight” size=”8″ onKeyUp=”calcweight()”> </td>
</tr>
<table>
<tr>
<td width=”160″> <input type=”button” value=”Calculate Weight” onClick=”calcweight()”> </td>
</tr>
</table>
</body>
<script language = “JavaScript”>
<!– hide from non-javascript browsers
function calcweight()
{
var axle = ‘single’;
var axle = ‘tandem’;
var season = ‘Ban season’;
var season = ‘Post ban’;
if (axle == ‘single’) {
if (season == ‘Ban season’) {axl = 9100; }
if (season == ‘Post ban’) {axl = 10000; }
document.write.weight.value=axl+ ” kg. ”
}
if (axle == ‘tandem’) {
if (season == ‘Ban season’) {axl = 17000; }
if (season == ‘Post ban’) {axl = 19000; }
document.write.weight.value=axl+ ” kg. ”
}
}