I have a form that contains two <select> drop down list that contain numbers 0-10
and and <Input type=text> field that I want to contain the value of the addition of what is in <select name=num1> and select
<select name=num2>
Example:
one drop down list contains 2
the other drop down list contains 3
2 + 3 = 5
so 5 would appear in the input box as a value
any ideas how to accomplish this in javascript
Code:
<script language="javascript">
numberindex=1
document.write("<FORM NAME=\"Totals\">")
document.write("<SELECT name=\"num1\">")
for (var number=0; number<=10; number++)
{
alert(number)
document.write("<OPTION value="+number+numberindex+">"+number+"</option>")
}
document.write("</SELECT>")
document.write("<SELECT name=\"num2\">")
for (var number=0; number<=10; number++)
{
alert(number)
document.write("<OPTION value="+number+numberindex+">"+number+"</option>")
}
document.write("</SELECT>")
document.write("<INPUT TYPE=\"text\" NAME=\"Total\" value=\" \">")
document.write("</FORM>")
</script>
Newbie in search of knowledge