Is it possible to attach validator to a Checkbox?

classic Classic list List threaded Threaded
3 messages Options
Reply | Threaded
Open this post in threaded view
|

Is it possible to attach validator to a Checkbox?

balapal
Hi,

I was trying to apply @AssertTrue on a boolean field.
I noticed that it is ignored during the server side validation. So I
implemented custom validation on my page in onValidate().
Now I tried to attach a custom client side validation to my field annotated
with @AssertTrue as it is described at
http://jumpstart.doublenegative.com.au/jumpstart7/examples/input/contributingvalidators

But it does not seem to work either. This made me wonder if there is
validation on checkbox/boolean is ignored/not added on purpose.

Is this a correct observation?
I guess I will need to create a page specific JS for this particular
checkbox validation. Any other suggestions?

Cheers,
Balazs


On 13 April 2014 23:51, Balázs Palcsó <[hidden email]> wrote:

> @AssertTrue JSR-303 annotation is what I need
> http://docs.jboss.org/hibernate/stable/beanvalidation/api/javax/validation/constraints/AssertTrue.html
> Just need to get it working with tapestry-beanvalidator.
>
>
> On 12 April 2014 15:40, Balázs Palcsó <[hidden email]> wrote:
>
>> Hi All,
>>
>> I need to implement a registration form where the user has to accept the
>> terms & conditions of the site by ticking a checkbox.
>> I was wondering somebody has come across a tapestry extension that does
>> something like this.
>> I would say that a custom validator could solve this.
>>
>> Thanks and regards,
>> Balazs
>>
>
>
Reply | Threaded
Open this post in threaded view
|

Re: Is it possible to attach validator to a Checkbox?

JumpStart
This might be the client-side counterpart of https://issues.apache.org/jira/browse/TAP5-2075 ?

On 17/04/2014, at 7:08 AM, Balázs Palcsó wrote:

> Hi,
>
> I was trying to apply @AssertTrue on a boolean field.
> I noticed that it is ignored during the server side validation. So I
> implemented custom validation on my page in onValidate().
> Now I tried to attach a custom client side validation to my field annotated
> with @AssertTrue as it is described at
> http://jumpstart.doublenegative.com.au/jumpstart7/examples/input/contributingvalidators
>
> But it does not seem to work either. This made me wonder if there is
> validation on checkbox/boolean is ignored/not added on purpose.
>
> Is this a correct observation?
> I guess I will need to create a page specific JS for this particular
> checkbox validation. Any other suggestions?
>
> Cheers,
> Balazs
>
>
> On 13 April 2014 23:51, Balázs Palcsó <[hidden email]> wrote:
>
>> @AssertTrue JSR-303 annotation is what I need
>> http://docs.jboss.org/hibernate/stable/beanvalidation/api/javax/validation/constraints/AssertTrue.html
>> Just need to get it working with tapestry-beanvalidator.
>>
>>
>> On 12 April 2014 15:40, Balázs Palcsó <[hidden email]> wrote:
>>
>>> Hi All,
>>>
>>> I need to implement a registration form where the user has to accept the
>>> terms & conditions of the site by ticking a checkbox.
>>> I was wondering somebody has come across a tapestry extension that does
>>> something like this.
>>> I would say that a custom validator could solve this.
>>>
>>> Thanks and regards,
>>> Balazs
>>>
>>
>>


---------------------------------------------------------------------
To unsubscribe, e-mail: [hidden email]
For additional commands, e-mail: [hidden email]

Reply | Threaded
Open this post in threaded view
|

Re: Is it possible to attach validator to a Checkbox?

balapal
Thanks Geoff. It looks like. I have commented the issue.


On 17 April 2014 03:49, Geoff Callender <[hidden email]
> wrote:

> This might be the client-side counterpart of
> https://issues.apache.org/jira/browse/TAP5-2075 ?
>
> On 17/04/2014, at 7:08 AM, Balázs Palcsó wrote:
>
> > Hi,
> >
> > I was trying to apply @AssertTrue on a boolean field.
> > I noticed that it is ignored during the server side validation. So I
> > implemented custom validation on my page in onValidate().
> > Now I tried to attach a custom client side validation to my field
> annotated
> > with @AssertTrue as it is described at
> >
> http://jumpstart.doublenegative.com.au/jumpstart7/examples/input/contributingvalidators
> >
> > But it does not seem to work either. This made me wonder if there is
> > validation on checkbox/boolean is ignored/not added on purpose.
> >
> > Is this a correct observation?
> > I guess I will need to create a page specific JS for this particular
> > checkbox validation. Any other suggestions?
> >
> > Cheers,
> > Balazs
> >
> >
> > On 13 April 2014 23:51, Balázs Palcsó <[hidden email]> wrote:
> >
> >> @AssertTrue JSR-303 annotation is what I need
> >>
> http://docs.jboss.org/hibernate/stable/beanvalidation/api/javax/validation/constraints/AssertTrue.html
> >> Just need to get it working with tapestry-beanvalidator.
> >>
> >>
> >> On 12 April 2014 15:40, Balázs Palcsó <[hidden email]> wrote:
> >>
> >>> Hi All,
> >>>
> >>> I need to implement a registration form where the user has to accept
> the
> >>> terms & conditions of the site by ticking a checkbox.
> >>> I was wondering somebody has come across a tapestry extension that does
> >>> something like this.
> >>> I would say that a custom validator could solve this.
> >>>
> >>> Thanks and regards,
> >>> Balazs
> >>>
> >>
> >>
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: [hidden email]
> For additional commands, e-mail: [hidden email]
>
>