also

TR("Type:",TD(INPUT(_type="checkbox",_name="options",_value="a",_size="0",requires
= IS_NOT_EMPTY(error_message="Please select
at least one check-box"))," A" ...

to have your required error message

Please check out the excellent web2py documentation for forms and
validators http://web2py.com/books/default/chapter/29/7#Validators


On Feb 21, 12:51 pm, whowhywhat <mads...@gmail.com> wrote:
> You can also just write a jquery validator for the same..
>
> On Feb 21, 12:49 pm, whowhywhat <mads...@gmail.com> wrote:
>
>
>
>
>
>
>
> > This should work. Although it is ugly (it gives a error message under
> > all the checkboxes :P ).. but does validate as you require. Please
> > check and let me know.
>
> > def multi_check_box():
> >     form = FORM(TABLE(
>
> > TR("Type:",TD(INPUT(_type="checkbox",_name="options",_value="a",_size="0",requires
> > = IS_NOT_EMPTY())," A",
>
> > INPUT(_type="checkbox",_name="options",_value="b",_size="0")," B",
>
> > INPUT(_type="checkbox",_name="options",_value="c",_size="0")," C")),
> >             TR("",INPUT(_type="submit",_value="SUBMIT" ))))
> >     if form.accepts(request.vars,session):
>
> >     return dict(form=form)
>
> > On Feb 21, 11:09 am, Sanjeet Kumar <sanjeet....@gmail.com> wrote:
>
> > > TR("Type:",(TD(INPUT(_type="checkbox",_name="a",_value="a",_size="0"),"A"))),
>
> > > (TD(INPUT(_type="checkbox",_name="b",_value="b",_size="0"),"B")),
>
> > > (TD(INPUT(_type="checkbox",_name="c",_value="c",_size="0"),"C"))),
> > > TR("",INPUT(_type="submit",_value="SUBMIT" ))
>
> > > On Tue, Feb 21, 2012 at 11:28 AM, whowhywhat <mads...@gmail.com> wrote:
> > > > please could post your controller code..
>
> > > > On Feb 21, 10:32 am, Sanjeet Kumar <sanjeet....@gmail.com> wrote:
> > > > > I have the multiple check-box in one row in Controller I want to 
> > > > > validate
> > > > > it form controller when the user submit his request without selecting 
> > > > > any
> > > > > of the check-box than it should be shown the error message "Please 
> > > > > select
> > > > > at least one check-box"

Reply via email to