hi,
here's email validation code using vbscript
<HTML>
<HEAD>
<TITLE>E-Mail Validation using VBScript</TITLE>
</HEAD>
<BODY>
<script language="vbscript">
<!--
function emailval()
Dim emailAdd
emailAdd = form1.emailAddress
if emailAdd <> "" then
emailAdd = Cstr(emailAdd)
if emailAdd <> "" then
blnValidEmail = RegExpTest(form1.emailAddress.value)
if blnValidEmail then
alert "Valid email address"
else
alert "Not a valid email address"
end if
end if
RegExpTest(sEmail)
Else
msgbox "hi"
End If
end function
Function RegExpTest(sEmail)
RegExpTest = false
Dim regEx, retVal
Set regEx = New RegExp
' Create regular expression:
regEx.Pattern ="^[\w]{1,}\@([\da-zA-Z-]{1,}\.){1,}[\da-zA-Z-]{2,3}$"
' Set pattern:
regEx.IgnoreCase = true
' Set case sensitivity.
retVal = regEx.Test(sEmail)
' Execute the search test.
If not retVal Then
exit function
End If
RegExpTest = true
End Function
-->
</script>
<form name="form1" method="post" action="valid.html">
<input maxLength="60" size="30" name="emailAddress" >
<input name=btn_reg onclick ="emailval()" type="submit" value="Click To Register"></P>
</form>
</BODY>
</HTML>
here's email validation code using vbscript
<HTML>
<HEAD>
<TITLE>E-Mail Validation using VBScript</TITLE>
</HEAD>
<BODY>
<script language="vbscript">
<!--
function emailval()
Dim emailAdd
emailAdd = form1.emailAddress
if emailAdd <> "" then
emailAdd = Cstr(emailAdd)
if emailAdd <> "" then
blnValidEmail = RegExpTest(form1.emailAddress.value)
if blnValidEmail then
alert "Valid email address"
else
alert "Not a valid email address"
end if
end if
RegExpTest(sEmail)
Else
msgbox "hi"
End If
end function
Function RegExpTest(sEmail)
RegExpTest = false
Dim regEx, retVal
Set regEx = New RegExp
' Create regular expression:
regEx.Pattern ="^[\w]{1,}\@([\da-zA-Z-]{1,}\.){1,}[\da-zA-Z-]{2,3}$"
' Set pattern:
regEx.IgnoreCase = true
' Set case sensitivity.
retVal = regEx.Test(sEmail)
' Execute the search test.
If not retVal Then
exit function
End If
RegExpTest = true
End Function
-->
</script>
<form name="form1" method="post" action="valid.html">
<input maxLength="60" size="30" name="emailAddress" >
<input name=btn_reg onclick ="emailval()" type="submit" value="Click To Register"></P>
</form>
</BODY>
</HTML>