requiredvalidator for checkbox

Ask a Question related to ASP.NET General, Design and Development.

  1. #1

    Default requiredvalidator for checkbox

    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 Guest

  2. Similar Questions and Discussions

    1. [PHP] Q: How to get the value of a checkbox of which name without '[]'?
      > Consider the following form in a HTML file:
    2. checkbox
      I know there is a way to update records with a checkbox. Is there a way to update this records (with different value)by unchecking the checkbox?
    3. Howto bind CheckBox to the datagrid/ Then update the database field when the checkbox is clicked.
      I am trying to update the database field when the checkbox is clicked. I am trying to modified the following solution but.. got stuck on the...
    4. Q: How to get the value of a checkbox of which name without '[]'?
      Consider the following form in a HTML file: .... <input type=checkbox name="box" value=1> <input type=checkbox name="box" value=2> <input...
    5. Checkbox - How can i get the value ?
      Hi, I have an application asp.net using datalist with checkbox for each datalist item... I want to get the value of the item that is checked but...
  3. #2

    Default Re: requiredvalidator for checkbox

    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 >" <Shane_Story@online.msn.com <remove the 'online.' to send me
    mail> wrote in message news:euuXhosVDHA.2040@TK2MSFTNGP11.phx.gbl...
    > 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 Guest

  4. #3

    Default Re: requiredvalidator for checkbox

    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 >" <Shane_Story@online.msn.com <remove the 'online.' to send me
    mail> wrote in message news:ew$9nrsVDHA.2104@TK2MSFTNGP10.phx.gbl...
    > Yeah I know, but when I click ControlToValidate for, the checkbox controls
    > don't list????
    >
    > How did you handle that?
    >
    > "Marina" <zlatkinam@nospam.hotmail.com> wrote in message
    > news:errZRqsVDHA.652@tk2msftngp13.phx.gbl...
    > > 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 >" <Shane_Story@online.msn.com <remove the 'online.' to send me
    > > mail> wrote in message news:euuXhosVDHA.2040@TK2MSFTNGP11.phx.gbl...
    > > > 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 Guest

  5. #4

    Default Re: requiredvalidator for checkbox

    Muchas gracias! :)

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

    Shane

    "Marina" <zlatkinam@nospam.hotmail.com> wrote in message
    news:OHCzSusVDHA.2016@TK2MSFTNGP09.phx.gbl...
    > 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 >" <Shane_Story@online.msn.com <remove the 'online.' to send me
    > mail> wrote in message news:ew$9nrsVDHA.2104@TK2MSFTNGP10.phx.gbl...
    > > Yeah I know, but when I click ControlToValidate for, the checkbox
    controls
    > > don't list????
    > >
    > > How did you handle that?
    > >
    > > "Marina" <zlatkinam@nospam.hotmail.com> wrote in message
    > > news:errZRqsVDHA.652@tk2msftngp13.phx.gbl...
    > > > 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 >" <Shane_Story@online.msn.com <remove the 'online.' to send
    me
    > > > mail> wrote in message news:euuXhosVDHA.2040@TK2MSFTNGP11.phx.gbl...
    > > > > 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 Guest

Posting Permissions

  • You may not post new threads
  • You may post replies
  • You may not post attachments
  • You may not edit your posts

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139