We have a lbs to kg converter on our home page honeybeez.co.uk (not yet live but viewable), it's misbehaving by going to the top of the page and dumping the result when submiting (converting) the form.
<script>
<!-- hide script
function calc(val,factor,putin) {
if (val == "") {
val = "0"
}
evalstr = "document.ConverTable."+putin+ ".value = "
evalstr = evalstr + val + "/" + factor
document.ConverTable.ckgrams.value=Math.round((eval(evalstr))*100)/100
}
// unhide script -->
</script>
<form NAME="ConverTable">
<table border="0" align="center">
<tr><td colspan=2 align="center"><b>Convert lbs to Kgs</b></td></tr>
<tr><td align="center">lbs <input SIZE="10" onChange="calc(this.value,2.2,'ckgrams')"> > </td>
<td align="center"><input NAME="ckgrams" SIZE="10"> kgs</td></tr>
<tr><td colspan=2 align="center"><input type="image" value="convert" src="http://www.honeybeez.co.uk/acatalog/convert.gif" border="0" alt="convert"><input type="image" value="reset" src="http://www.honeybeez.co.uk/acatalog/reset.gif" border="0" alt="reset"></td></tr>
</table>
</form>
any ideas why? it worked fine until we changed the buttons to images.
TNX for your help.
<script>
<!-- hide script
function calc(val,factor,putin) {
if (val == "") {
val = "0"
}
evalstr = "document.ConverTable."+putin+ ".value = "
evalstr = evalstr + val + "/" + factor
document.ConverTable.ckgrams.value=Math.round((eval(evalstr))*100)/100
}
// unhide script -->
</script>
<form NAME="ConverTable">
<table border="0" align="center">
<tr><td colspan=2 align="center"><b>Convert lbs to Kgs</b></td></tr>
<tr><td align="center">lbs <input SIZE="10" onChange="calc(this.value,2.2,'ckgrams')"> > </td>
<td align="center"><input NAME="ckgrams" SIZE="10"> kgs</td></tr>
<tr><td colspan=2 align="center"><input type="image" value="convert" src="http://www.honeybeez.co.uk/acatalog/convert.gif" border="0" alt="convert"><input type="image" value="reset" src="http://www.honeybeez.co.uk/acatalog/reset.gif" border="0" alt="reset"></td></tr>
</table>
</form>
any ideas why? it worked fine until we changed the buttons to images.
TNX for your help.
Comment