Guest_imported
New member
- Jan 1, 1970
- 0
i tried following code
<html>
<head>
<script language="VBScript">
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 >= "a" or ch <= "z" or (ch >= "A" or ch <= "Z" then
alert " a string"
'return true
else
alert "not a string"
'return false
end if
next
end function
</script>
</head>
<body>
<form name="form1">
<input type="text" name="firstname" onchange="isNotAlphabets()">
</form>
</body>
</html>
for any value(character or numeric) inserted in it,it is giving " a string" message
is there any other way to do it in vbscript
(a sample code will be helpful)
<html>
<head>
<script language="VBScript">
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 >= "a" or ch <= "z" or (ch >= "A" or ch <= "Z" then
alert " a string"
'return true
else
alert "not a string"
'return false
end if
next
end function
</script>
</head>
<body>
<form name="form1">
<input type="text" name="firstname" onchange="isNotAlphabets()">
</form>
</body>
</html>
for any value(character or numeric) inserted in it,it is giving " a string" message
is there any other way to do it in vbscript
(a sample code will be helpful)