I am trying to add the numbers of two variables together as in 1000 + 4000 = 5000. But I keep geting 10004000. In the code below I use count1x += add
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=windows-1252">
<meta name="GENERATOR" content="Microsoft FrontPage 4.0">
<meta name="ProgId" content="FrontPage.Editor.Document">
<title>enter first number</title>
<Script language='javascript'>
var count1x = 0
var count2x = 0
var count1y = 0
var count2y = 0
var add = 4000
function number_set() {
count1x = document.forms.set_number.number1x.value;
count2x = document.forms.set_number.number2x.value;
count1y = document.forms.set_number.number1y.value;
count2y = document.forms.set_number.number2y.value;
count1x += add
document.forms.set_number.test.value = count1x
}
</script>
</head>
<body>
<form name="set_number">
<font size="5">enter first number. </font><font size="6" color="#FF0000">x</font><input name="number1x" size="20"><font size="5">enter
second number. </font><font size="6" color="#FF0000">x</font><input name="number2x" size="20">
<input type='reset'>
<p>
<font size="5">
enter first number. </font><font size="6" color="#FF0000">y</font><input name="number1y" size="20"><font size="5">enter second number.
</font><font size="6" color="#FF0000">y</font><input name="number2y" size="20">
<input type='button' value='http://www.webdeveloper.com/forum/archive/index.php/set numbers' onclick='Javascript:number_set()'>
<input name="test" size="20">
</p>
</form>
</body>
</html>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=windows-1252">
<meta name="GENERATOR" content="Microsoft FrontPage 4.0">
<meta name="ProgId" content="FrontPage.Editor.Document">
<title>enter first number</title>
<Script language='javascript'>
var count1x = 0
var count2x = 0
var count1y = 0
var count2y = 0
var add = 4000
function number_set() {
count1x = document.forms.set_number.number1x.value;
count2x = document.forms.set_number.number2x.value;
count1y = document.forms.set_number.number1y.value;
count2y = document.forms.set_number.number2y.value;
count1x += add
document.forms.set_number.test.value = count1x
}
</script>
</head>
<body>
<form name="set_number">
<font size="5">enter first number. </font><font size="6" color="#FF0000">x</font><input name="number1x" size="20"><font size="5">enter
second number. </font><font size="6" color="#FF0000">x</font><input name="number2x" size="20">
<input type='reset'>
<p>
<font size="5">
enter first number. </font><font size="6" color="#FF0000">y</font><input name="number1y" size="20"><font size="5">enter second number.
</font><font size="6" color="#FF0000">y</font><input name="number2y" size="20">
<input type='button' value='http://www.webdeveloper.com/forum/archive/index.php/set numbers' onclick='Javascript:number_set()'>
<input name="test" size="20">
</p>
</form>
</body>
</html>