gcook1
01-23-2006, 03:00 PM
I have a webform that users can use to reclassify charges. It's very basic. On each line, the user chooses radio button "From" or "To". They enter the account number the charge is moving from/to in textbox 1 and the dollar amount to move in textbox 2.
I need to run a validation check when they click the submit button. If the total of the "From" lines doesn't equal the total of the "To" lines, I want them to get a message box that tells them they're out of balance.
To do the validation, I tried a series of these, incrementing the Answer fields:
If Answer1 = "From" Then
FromTot = FromTot + Answer3
Else
ToTot = ToTot + Answer3
End If
Then the plan was to compare FromTot and ToTot. If they didn't equal, a messagebox would pop up. But when I tested it, the amounts are being treated as text. So if I had three "to" fields of 1, 2, 3, ToTot equalled 123 rather than 6.
How do I get ASP to treat the textbox values as integers rather than text?
I need to run a validation check when they click the submit button. If the total of the "From" lines doesn't equal the total of the "To" lines, I want them to get a message box that tells them they're out of balance.
To do the validation, I tried a series of these, incrementing the Answer fields:
If Answer1 = "From" Then
FromTot = FromTot + Answer3
Else
ToTot = ToTot + Answer3
End If
Then the plan was to compare FromTot and ToTot. If they didn't equal, a messagebox would pop up. But when I tested it, the amounts are being treated as text. So if I had three "to" fields of 1, 2, 3, ToTot equalled 123 rather than 6.
How do I get ASP to treat the textbox values as integers rather than text?