Dolan
05-15-2003, 04:17 PM
... multiple fields. Didn't know if I should post here or in the Javascript section...
This is how my code looks like:
<form name="one">
<font color="white" size="2">One:
<input type="text" name="input">
<input type="button" onClick="wone(one.input.value);" value="Calculate!">
<font color="white" size="2">Price:
<input type="text" name="output" disabled="disabled">
</form>
<form name="two">
<font color="white" size="2">Two:
<input type="text" name="input">
<input type="button" onClick="wtwo(two.input.value);" value="Calculate!">
<font color="white" size="2">Price:
<input type="text" name="output" disabled="disabled">
</form>
<form name="three">
<font color="white" size="2">Three:
<input type="text" name="input">
<input type="button" onClick="wthree(three.input.value);" value="Calculate!">
<font color="white" size="2">Price:
<input type="text" name="output" disabled="disabled">
</form>
<form name="four">
<font color="white" size="2">Four:
<input type="text" name="input">
<input type="button" onClick="wfour(four.input.value);" value="Calculate!">
<font color="white" size="2">Price:
<input type="text" name="output" disabled="disabled">
</form>
<script type="text/javascript">
function wone(w) {
one.output.value = Math.floor(180000000 / w);
}
function wtwo(w) {
two.output.value = Math.floor(95000000 / w);
}
function wthree(w) {
three.output.value = Math.floor(45000000 / w);
}
function wfour(w) {
four.output.value = Math.floor(165000 / w);
}
</script>
Anyone that can help me? I need a dropdown menubox insted of all the fields.
This is how my code looks like:
<form name="one">
<font color="white" size="2">One:
<input type="text" name="input">
<input type="button" onClick="wone(one.input.value);" value="Calculate!">
<font color="white" size="2">Price:
<input type="text" name="output" disabled="disabled">
</form>
<form name="two">
<font color="white" size="2">Two:
<input type="text" name="input">
<input type="button" onClick="wtwo(two.input.value);" value="Calculate!">
<font color="white" size="2">Price:
<input type="text" name="output" disabled="disabled">
</form>
<form name="three">
<font color="white" size="2">Three:
<input type="text" name="input">
<input type="button" onClick="wthree(three.input.value);" value="Calculate!">
<font color="white" size="2">Price:
<input type="text" name="output" disabled="disabled">
</form>
<form name="four">
<font color="white" size="2">Four:
<input type="text" name="input">
<input type="button" onClick="wfour(four.input.value);" value="Calculate!">
<font color="white" size="2">Price:
<input type="text" name="output" disabled="disabled">
</form>
<script type="text/javascript">
function wone(w) {
one.output.value = Math.floor(180000000 / w);
}
function wtwo(w) {
two.output.value = Math.floor(95000000 / w);
}
function wthree(w) {
three.output.value = Math.floor(45000000 / w);
}
function wfour(w) {
four.output.value = Math.floor(165000 / w);
}
</script>
Anyone that can help me? I need a dropdown menubox insted of all the fields.