[ic] [Error] Tag

Dave Barr dave.barr@cricinfo.com
Thu, 8 Feb 2001 10:20:27 +0000

>I have a checkout_profile on one page that checks for the name and 
>address and email address of a user. In the past if the user typed 
>in "blah" as a email address MV use to say something to the affect 
>of "is this really your email address?", on the page if they put in 
>"blah" it's considered legit and the page passes.
>I'm not use to the [error] tags, but is there a way to make it check 
>to see if the email address has a @ symbol and a .com or .net or 
>[set checkout_profile]
>&fatal = yes
>&set=mv_email [value email]
>[error all=1 show_var=1 show_error=1 joiner='<br>']

Hi Ven,

I put profiles under:

Along the lines of:
__NAME__                            check_email
&fatal = yes

Otherwise heres another way of doing it directly on the page:

[if value form_errors]
   <B><FONT COLOR=RED>[value form_errors]</FONT></B><P>
   [value name=form_errors set=""]

[set check_email]
   [if type=value term=email op="!~" compare="/\w+@[-A-Za-z0-9.]+\.[A-Za-z]+/"]
     form_errors=We need a VALID eMail address for you.

<FORM ACTION="[process-target]" METHOD=POST>
<INPUT TYPE=hidden NAME=mv_todo VALUE=return>
<INPUT TYPE=hidden NAME=mv_check VALUE=check_email>
<INPUT TYPE=text NAME=email VALUE="[value email]" SIZE="20" MAXLENGTH="128">

It should take you to index.html if a successful regex is performed 
on the address otherwise an error in red will be shown...



Dave Barr        eCommerce Technical Manager      CricInfo Ltd
www.cricinfo.com   dave.barr@cricinfo.com    Tel: 01249 700748