Hi,
I have a form done in .asp. In this form the user will be asked to
enter an amount. To insure the proper amount is entered, how can I
validate the fields to force the user to enter an increment amount. For
Example, increments of a 100.00 or 2,000.00.
This is what I have so far, but the function keep return False even if
I put in the correct increment amount.
<%Function IsExactMultiple(strToBeTested, intMultipleOf)
IsExactMultiple= False
If IsNumeric(strToBeTested) = False Then Exit Function
If Len(strToBeTested) = 0 Then Exit Function
strToBeTested = CDbl(strToBeTested)
IsExactMultiple= ((strToBeTested MOD intMultipleOf) = 0)
End Function
If IsExactMutilple= true Then
Response.Write("Enter the correct format")
End If
%>
<form>
<input type="text" name="dollar" size="10" value="<%Response.Write
(IsExactMultiple(Request.Form("dollar"), 1000))%>">
<input type="submit">
</form>
Thanks for your help!
I have a form done in .asp. In this form the user will be asked to
enter an amount. To insure the proper amount is entered, how can I
validate the fields to force the user to enter an increment amount. For
Example, increments of a 100.00 or 2,000.00.
This is what I have so far, but the function keep return False even if
I put in the correct increment amount.
<%Function IsExactMultiple(strToBeTested, intMultipleOf)
IsExactMultiple= False
If IsNumeric(strToBeTested) = False Then Exit Function
If Len(strToBeTested) = 0 Then Exit Function
strToBeTested = CDbl(strToBeTested)
IsExactMultiple= ((strToBeTested MOD intMultipleOf) = 0)
End Function
If IsExactMutilple= true Then
Response.Write("Enter the correct format")
End If
%>
<form>
<input type="text" name="dollar" size="10" value="<%Response.Write
(IsExactMultiple(Request.Form("dollar"), 1000))%>">
<input type="submit">
</form>
Thanks for your help!