trabenst
02-22-2005, 08:01 PM
I am having some problems making this work can some tell me what I am doing wrong. I have 2 text boxes when a user enters numbers into them I what it to add both text box numbers together an verify they are not < 0 or > 100. If this statement is returned false I do not want my database to be updated.
form onsubmit ="return checkTotal()" method="POST" action="--WEBBOT-SELF--">
input type="text" name="WDA_FDMS" size="8">
input type="text" name="WDA_Concord" size="8">
input type="submit" value="Submit" name="B1">
input type="reset" value="Reset" name="B2">
/form>
script language = javascript>
var WDA_FDMS, WDA_Concord, Sum
function checkTotal()
{
Sum = WDA_FDMS + WDA_Concord
if (Sum < 0){
alert("Invalid total entered")
return false
}
if (Sum > 100){
alert("Invalid total entered")
return false
}
else
{
return true
}
}
/script>
form onsubmit ="return checkTotal()" method="POST" action="--WEBBOT-SELF--">
input type="text" name="WDA_FDMS" size="8">
input type="text" name="WDA_Concord" size="8">
input type="submit" value="Submit" name="B1">
input type="reset" value="Reset" name="B2">
/form>
script language = javascript>
var WDA_FDMS, WDA_Concord, Sum
function checkTotal()
{
Sum = WDA_FDMS + WDA_Concord
if (Sum < 0){
alert("Invalid total entered")
return false
}
if (Sum > 100){
alert("Invalid total entered")
return false
}
else
{
return true
}
}
/script>