I use this for all my email validation, its not regEx but it works OK for me
function isEmail(str)
{
posAtSign = str.indexOf("@")
posDot =str.lastIndexOf(".")
end = str.length-1
start = 0
missing = -1
if( str.length == 2)
{ return false }
if( posAtSign == missing || posAtSign == start || posAtSign == end )
{ return false }
if ( posDot < posAtSign || posDot == missing || posDot == start || posDot ==
end )
{ return false }
return true
}
>ok quick ?
>gunna quit using extensions to do my form validation
>
>2 things i need
>say i have this code
>
><InvalidTag LANGUAGE="JavaScript">
><!--
>function checkForm(){
> theform=document.reg_frm
>
> // Check member Number
> if (theform.memberN.value==""){
> alert("Please provide your Membership Number, like
> 000-0000.")
> theform.memberN.focus()
> return false;
> }
>
> // Check email
> if (theform.email.value==""){
> alert("Please provide a Email.")
> theform.email.focus()
> return false;
> }
>
>
>
>how would i add a reg expression for the email
>and how would i have the memberN in format like 000-0000
>
>sorry, i know i was given the code for the 2nd part but now i cant friggin
>find it
>
>tia
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~|
Special thanks to the CF Community Suite Gold Sponsor - CFHosting.net
http://www.cfhosting.net
Message: http://www.houseoffusion.com/lists.cfm/link=i:4:187862
Archives: http://www.houseoffusion.com/cf_lists/threads.cfm/4
Subscription: http://www.houseoffusion.com/lists.cfm/link=s:4
Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=89.70.4
Donations & Support: http://www.houseoffusion.com/tiny.cfm/54