Hi Alex,
well i think you need use <fd:messages id=".."/> for show the error
message and you can write a validator for the form <fd:validation>.
for example:
In the definition.xml you can write:
<fd:validation>
<fd:javascript>
// write the code for validation
// set the message error : widget.getChild("widget name for
message").addMessage(...);
// always return true or false
</fd:javascript>
</fd:validation>
<fd:widgets>
<fd:messages id="widget name for message">
<fd:label>widget label</fd:label>
</fd:messages>
.....
other widgets
<fd:widgets>
Cheers,
Carlos Ch�vez.
Alex Romayev Escribio :-)
> Hi Carlos,
>
> Unfortunately in my case I don't want to set the error
> on either email or password widgets, since I don't
> want to let the user know which one of the two is
> incorrect. Setting it always on one of them is
> misleading to the user.
>
> I also tried using a hidden widget, and attaching the
> validator to it, but for some reason it continues to
> think that it's invalid, even after the error has been
> corrected, not sure why.
>
> Cheers,
> -Alex
>
> --- Carlos Ch�vez <[EMAIL PROTECTED]>
> wrote:
>>
>> Alex Romayev Escribio :-)
>> > Hi,
>> >
>> > I'd like to create a validator for my login form.
>> It
>> > needs to check that email/password combination is
>> > valid and if not, display "Invalid email/password
>> > combination" message.
>> >
>> > Question. Since the message applies to two
>> widgets, I
>> > assume I would need to create a custom validator
>> and
>> > add it to form itself. However, Form widget does
>> not
>> > implement ValidationErrorAware, so I would assume,
>> I
>> > would not be able to set a message on the form
>> itself.
>> > Is this correct? Is there a way of achieving
>> what I
>> > need?
>>
>> Hi Alex,
>> I have something similar.
>>
>> I have three widget:
>> 1. current_passwd (Current Password)
>> 2. new_passwd (New Password)
>> 3. repeat_passwd (Retype new Password)
>>
>> Then, if the current password is not equal to the
>> password in the database
>> then a set the validation error for the widget
>> current_passwd.
>> if the new password are not equal to the retype
>> password then
>> i set the validation error for the widget
>> repeat_passwd.
>>
>> that is the option what a see.
>>
>> I hope help you.
>>
>> Cheers
>> Carlos Ch�vez.
>>
>> >
>> > Thanks,
>> > -Alex
>> >
>> >
>>
> ---------------------------------------------------------------------
>> > To unsubscribe, e-mail:
>> [EMAIL PROTECTED]
>> > For additional commands, e-mail:
>> [EMAIL PROTECTED]
>> >
>>
>>
>> --
>> Carlos Ch�vez
>>
>>
> ---------------------------------------------------------------------
>> To unsubscribe, e-mail:
>> [EMAIL PROTECTED]
>> For additional commands, e-mail:
>> [EMAIL PROTECTED]
>>
>>
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
>
--
Carlos Ch�vez
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]