Sun Apr 03, 2011 10:09 pm
<!-- form to enter a number to be validated . -->
<form method="get" action ="<%= Request.ServerVariables("SCRIPT_NAME") %>" >
<input type ="text" name="number"><br>
<input type="submit">
</form>
<%
Dim strNumber , intNumber , blnFlag
If Request.ServerVariables("CONTENT_LENGTH") <> 0 Then
strNumber = Trim(Request.form("number"))
' check if strNumber is a number.
If isNumeric(strNumber ) Then
' convert from string to integer.
intNumber = CInt(strNumber )
' if number less than 10 then success
If 10 >= intNumber Then
blnFlag = True
End If
'if a number is entered then display this
Else
Response.Write "not valid number<br>"
End If
'number is entered ok .
'check the value of boolean
If blnFlag = True Then
Response.Write("Number = " & intNumber )
print message for invalid number.
Else
Response.Write("Enter an number less than 10 ")
End If
End If
%>
Codemiles.com is a participant in the Amazon Services LLC Associates Program, an affiliate advertising program designed to provide a means for sites to earn advertising fees by advertising and linking to Amazon.com
Powered by phpBB © phpBB Group.