Mike Greene

Greenhorn
+ Follow
since Dec 06, 2000
Merit badge: grant badges
For More
Cows and Likes
Cows
Total received
In last 30 days
0
Forums and Threads

Recent posts by Mike Greene

Here's how it should read, try this
---------------------------------
<html>
<head>
<SCRIPT LANGUAGE="JavaScript">
function adCalc(form)
{

var provider = form.provider.value;
var customer = form.customer.value;
var total = form.total.value;

form.total.value = (provider + customer);

}
</script>
</head>
<body>
<form method=post>
<tr>
<input type=text name=provider size=8 value="" onFocus="select()"></td> </tr><br>
<tr>
<td align=center><input ype=text name=customer size=8 value="" onFocus="select()"></td>
</tr><br>
<tr>
<td align=center><input type=text name=total size=8 value=""
onFocus="select()"></td></tr><br>
<tr>
<input type=button value="Solve" onClick="adCalc(this.form)">
<input type=reset value=reset></td></tr>
</form>
</body>
</html>
Right now its multiplying, try to add the two variables
here it is
------------------------------------------------------------
<html>
<head>
<SCRIPT LANGUAGE="JavaScript">
function adCalc(form)
{

var provider = form.provider.value;
var customer = form.customer.value;
var total = form.total.value;

form.total.value = (provider * customer); //solve for exposures

}
</script>
</head>
<body>
<form method=post>
<tr>
<td align=center>Provider Cost:</td>
<td align=center><input type=text name=provider size=8 value="" onFocus="select()"></td>
</tr><br>
<tr>
<td align=center>Customer Cost:</td>
<td align=center><input ype=text name=customer size=8 value="" onFocus="select()"></td>
</tr><br>
<tr>
</html>
<td align=center>Total:</td>
<td align=center><input type=text name=total size=8 value=""
onFocus="select()"></td></tr><br>
<tr>
<input type=button value="Solve" onClick="adCalc(this.form)">
<input type=reset value=reset></td></tr>
</form>
</body>
</html>
how do I add two textfields without it concatinating them???
e.g.
1 + 2 = 3
but when I do it, its says
1 + 2 = 12
24 years ago
Yeah its basically a html page with embedded javascript
here's my problem
field1 = 1
field2 = 2
field3 = 12
rather than 3. I realize its concatanating the fields as strings.
thanks for the help
I'm creating a form on Oracle Webdb and I'm having a terrible time adding three textfields. I know I have to convert to an integer but no luck. When I call the function and pass the variables, it seems as though parseInt(field1) is not working "field1 being the textfield". I have set up some hard coded values so I know my function is correct but ..... anyways, would anyone like to point me in the right direction.
thanks