[ic] Re: [data session errors] overwritten?

Paul Jordan interchange-users@icdevgroup.org
Thu Jul 4 01:07:00 2002


> > I tried to use the following codes suggested by Bill (attached
> > below for reference), and also wrote my own error check routine as
> > a GlobalSub (also attached below) to verify if 2 email addresses
> > are the same.  This custom error check routine is called in
> > mv_order_profile, like this:
> >
> >
> > [set my_account_profile]
> > email=required
> > email_confirm=required
> >
> > email=email
> > email_confirm=email
> >
> > email=email_verification
> > email_confirm=email_verification
> >
> > &fatal = yes
> > [/set]
> >
> >
> > <INPUT TYPE=hidden NAME=mv_order_profile VALUE=my_account_profile>
> >
> >
> > However, it seemed that the $Session->{errors}{email} set by my
> > GlobalSub has overwritten the previous Data Session Errors of the
> > Email field, such that if both Email and Email_confirm fields are
> > blank, they will not showing up in red at all to signify that
> > they're blank, and not an email address, and do not match.
> >
> > If I change their orders, such that it is like this:
> >
> >
> > [set my_account_profile]
> > email=email_verification
> > email_confirm=email_verification
> >
> > email=required
> > email_confirm=required
> >
> > email=email
> > email_confirm=email
> >
> > &fatal = yes
> > [/set]
> >
> >
> > when the 2 fields are blank, the errors show up in red alright, but
> > when 2 different email addresses are entered, they're not compared,
> > ie, email_verification doesn't seem to be called.  Either that, or
> > it was called, but its Data Session Errors is overwritten (it
> > seemed that way).
> >
> > Any pointers as to what could be wrong, and how I might overcome
> > that?  Much thanks!


You can try this in your profile


email=email
[if type=value term=email_confirm op=ne compare="[value email]"]
&calc = delete $CGI->{email_confirm}; 1;
email_confirm=mandatory Email_confirm doesn't match email.[/if]


Ed showed me that :)

Paul