requiredvalidator for checkbox

Discussion in 'ASP .Net' started by SStory, Jul 30, 2003.

  1. SStory

    SStory Guest

    Is there no way to require a checkbox to be checked in ASP.NET?
    The requiredvalidator control doesn't work for it--should I make a
    server--roundtrip for that and check during the btn_click event? Is there
    another way?

    Thanks,
    Shane
     
    SStory, Jul 30, 2003
    #1
    1. Advertising

  2. SStory

    Marina Guest

    I've used a CustomValidator, and wrote some client side javascript to do
    this type of check. That way you will avoid the roundtrip.

    You could just as easily forgo the validators, and just write your own
    routine for this, but I had some other validators on the page that were
    being displayed in a validation summary, so it was more convenient.

    "SStory >" < <remove the 'online.' to send me
    mail> wrote in message news:...
    > Is there no way to require a checkbox to be checked in ASP.NET?
    > The requiredvalidator control doesn't work for it--should I make a
    > server--roundtrip for that and check during the btn_click event? Is there
    > another way?
    >
    > Thanks,
    > Shane
    >
    >
     
    Marina, Jul 30, 2003
    #2
    1. Advertising

  3. SStory

    Marina Guest

    custom validators do not require you to set that property. You can leave it
    blank. Be sure to define a javascript function, and list it in the property
    that speficies which client side function to run for the validation.

    "SStory >" < <remove the 'online.' to send me
    mail> wrote in message news:ew$...
    > Yeah I know, but when I click ControlToValidate for, the checkbox controls
    > don't list????
    >
    > How did you handle that?
    >
    > "Marina" <> wrote in message
    > news:...
    > > I've used a CustomValidator, and wrote some client side javascript to do
    > > this type of check. That way you will avoid the roundtrip.
    > >
    > > You could just as easily forgo the validators, and just write your own
    > > routine for this, but I had some other validators on the page that were
    > > being displayed in a validation summary, so it was more convenient.
    > >
    > > "SStory >" < <remove the 'online.' to send me
    > > mail> wrote in message news:...
    > > > Is there no way to require a checkbox to be checked in ASP.NET?
    > > > The requiredvalidator control doesn't work for it--should I make a
    > > > server--roundtrip for that and check during the btn_click event? Is

    > there
    > > > another way?
    > > >
    > > > Thanks,
    > > > Shane
    > > >
    > > >

    > >
    > >

    >
    >
     
    Marina, Jul 30, 2003
    #3
  4. SStory

    SStory Guest

    Muchas gracias! :)

    I am very glad that someone answered that question for me.

    Shane

    "Marina" <> wrote in message
    news:...
    > custom validators do not require you to set that property. You can leave

    it
    > blank. Be sure to define a javascript function, and list it in the

    property
    > that speficies which client side function to run for the validation.
    >
    > "SStory >" < <remove the 'online.' to send me
    > mail> wrote in message news:ew$...
    > > Yeah I know, but when I click ControlToValidate for, the checkbox

    controls
    > > don't list????
    > >
    > > How did you handle that?
    > >
    > > "Marina" <> wrote in message
    > > news:...
    > > > I've used a CustomValidator, and wrote some client side javascript to

    do
    > > > this type of check. That way you will avoid the roundtrip.
    > > >
    > > > You could just as easily forgo the validators, and just write your own
    > > > routine for this, but I had some other validators on the page that

    were
    > > > being displayed in a validation summary, so it was more convenient.
    > > >
    > > > "SStory >" < <remove the 'online.' to send

    me
    > > > mail> wrote in message news:...
    > > > > Is there no way to require a checkbox to be checked in ASP.NET?
    > > > > The requiredvalidator control doesn't work for it--should I make a
    > > > > server--roundtrip for that and check during the btn_click event? Is

    > > there
    > > > > another way?
    > > > >
    > > > > Thanks,
    > > > > Shane
    > > > >
    > > > >
    > > >
    > > >

    > >
    > >

    >
    >
     
    SStory, Jul 30, 2003
    #4
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Elie Medeiros via .NET 247

    Custom Validator not working without RequiredValidator

    Elie Medeiros via .NET 247, May 18, 2005, in forum: ASP .Net
    Replies:
    1
    Views:
    8,681
    William F. Robertson, Jr.
    May 18, 2005
  2. TJS
    Replies:
    3
    Views:
    555
  3. tshad

    RequiredValidator not working

    tshad, May 20, 2005, in forum: ASP .Net
    Replies:
    7
    Views:
    2,021
    Peter Blum
    May 21, 2005
  4. Shimon Sim
    Replies:
    4
    Views:
    22,164
    Patrick.O.Ige
    Feb 3, 2006
  5. Niraj Sikotara
    Replies:
    2
    Views:
    557
    Niraj Sikotara
    Sep 21, 2006
Loading...

Share This Page