Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

textbox validation-2

Status
Not open for further replies.

Guest_imported

New member
Jan 1, 1970
0
i tried following code
<html>
<head>
<script language=&quot;VBScript&quot;>
function isNotAlphabets()
dim i,ch
for i= 1 to len(form1.firstname.value)
ch = mid(form1.firstname.value,1,len(form1.firstname.value))
if (ch >= &quot;a&quot; or ch <= &quot;z&quot;) or (ch >= &quot;A&quot; or ch <= &quot;Z&quot;) then
alert &quot; a string&quot;
'return true
else
alert &quot;not a string&quot;
'return false
end if
next
end function
</script>
</head>
<body>
<form name=&quot;form1&quot;>
<input type=&quot;text&quot; name=&quot;firstname&quot; onchange=&quot;isNotAlphabets()&quot;>
</form>
</body>
</html>
for any value(character or numeric) inserted in it,it is giving &quot; a string&quot; message

is there any other way to do it in vbscript
(a sample code will be helpful)

 
Hey,

have a look at this post:

thread329-280334 may have to change it around a little to suit your own needs.

Mark
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top