cocoon-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From 321...@gmail.com
Subject Re: captcha validation & fd:failmessage
Date Tue, 11 Jul 2006 15:13:59 GMT
Hi Andrew,

thank you very much for your answer. I solved the issue in the meantime via
i18n Transformer.
Thanks again for your help
Marco



2006/7/11, Andrew Madu <andrewmadu@gmail.com>:
>
> Hi Marco,
> I do the same but using flowscript like so:
>
>     <fd:validation>
>         <fd:javascript>
>             var success = true;
>             var captcha_code = widget.lookupWidget("captcha_code");
>             var captcha_generated = cocoon.session.getAttribute
> ("captcha");
>             var parameters = {"supplied": captcha_code.value, "expected":
> captcha_generated};
>
>             try {
>
>                    if
> (parameters['supplied'].equals(parameters['expected'])) {
>                         cocoon.session.setAttribute("user",
> checkUserTest);
>                     } else {
>                         captcha_code.setValidationError(new
> Packages.org.apache.cocoon.forms.validation.ValidationError("The string
> you entered is incorrect. Please re-enter.", false));
>                         success = false;
>                     }
>
>
> HTH
>
> Andrew
>
>
>
> On 11/07/06, 321los@gmail.com < 321los@gmail.com> wrote:
> >
> > Hello,
> >
> > my aim is to use captcha validation on forms, including a custom
> > failmessage.
> > My try was like that:
> >
> >
> > <fd:captcha id="capt" required="true" length="5">
> >       <fd:help>case sensitive!</fd:help>
> >       <fd:datatype base="string"/>
> >       <fd:validation>
> >         <fd:captcha>
> >             <fd:failmessage>Wrong! Try again</fd:failmessage>
> >         </fd:captcha>
> >       </fd:validation>
> > </fd:captcha>
> >
> >
> > but the displayed error message still is "validation.captcha.mismatch"
> > Whats my mistake?
> >
> > Thanks for your help
> > Marco
> >
> >
>

Mime
View raw message