Link to home
Start Free TrialLog in
Avatar of rcbuchanan
rcbuchanan

asked on

Very Simple email validation onchange?

I need a very simple email validation script (so simple I can't do it :-( ). can u help?
I have this input field:

<input name="register_email" type="text" size="30" maxlength="50" onblur="this.value=this.value.replace(/ /g,'_')" onfocus="change2Msg(2);" value="<cfif isdefined('url.em')><cfoutput>#url.em#</cfoutput></cfif>">

I need to FORCE the user to stay in the input field if no '@' or '.' is part of the entered string.  I'm sure this is goofy but it would help me with a very simple task I need.

Does this make sense?

In otherwords ... when I tab (or click) into this text field 'register_email' and I fail to enter a text string that contains an '@' and an '.' (i.e. fred instead of 'fred@fred.com') then when I leave the field ... force the user BACK into the text input field.

(i need to keep that onfocus="change2Msg(2);" code in my line and the coldfusion output field for value.)


Thanks for any help!
Richard
SOLUTION
Avatar of reginab
reginab

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
ASKER CERTIFIED SOLUTION
Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial