Total members 11895 |It is currently Sat Dec 21, 2024 3:01 pm Login / Join Codemiles

Java

C/C++

PHP

C#

HTML

CSS

ASP

Javascript

JQuery

AJAX

XSD

Python

Matlab

R Scripts

Weka





Following is an example on how to validate an number
Code:
<!--  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 
%>
 




_________________
M. S. Rakha, Ph.D.
Queen's University
Canada


Author:
Mastermind
User avatar Posts: 2715
Have thanks: 74 time
Post new topic Reply to topic  [ 1 post ] 

  Related Posts  to : validation on number
 convert integer number to octal,hexadecimal number systems     -  
 convert octal number to decimal number     -  
 convert decimal number to octal number     -  
 XML validation against DTD     -  
 DNS Validation     -  
 Validation using Ajax     -  
 US Zip Code Validation     -  
 What will be validation for Zip code ?     -  
 validation using JavaScript     -  
 date validation in asp     -  



Topic Tags

ASP Validation
cron





Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group
All copyrights reserved to codemiles.com 2007-2011
mileX v1.0 designed by codemiles team
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