Forum Moderators: open
Here's my hacked effort so far... ;o(
<script type="text/javascript">
function add() {
document.getElementById('input').value=document.getElementById('input').value + .1;
}
function subtract() {
document.getElementById('input').value=document.getElementById('input').value - .1;
}
</script>
<form>
Value:
<input type="button" onClick="subtract();" value="-" name="button">
<input type="text" name="input" value="18.3" id="input" size="5" maxlength="4">
<input type="button" onClick="add();" value="+" name="button2">
</form>
It seems to work when subtracting but not when adding? If anybody can point me in the right diection, or even to an online tutorial, i'd seriously appreciate it!
Thanks in advance
Decbrad
document.getElementById('input').value = parseFloat(document.getElementById('input').value) + .1; <edit>
Just noticed another (recent) related thread which may help...
[webmasterworld.com...]