Page 2 of 2 FirstFirst 12
Results 11 to 12 of 12

Thread: Disable checkboxes based in other checkboxes.

  1. #11
    Join Date
    Dec 2004
    Location
    UK
    Posts
    2,358
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default

    Quote Originally Posted by Twey
    Quote Originally Posted by Ickyb0d
    maybe i'm just missing something... but if you only want one or the other checked... why not just use radio buttons?
    If there are more than one set of buttons, this could be problematical.
    Care to explain that line of reasoning?

    HTML Code:
    <fieldset>
      <legend>Platform</legend>
      <ul>
        <li>
          <label for="linux">
            <input id="linux" name="platform" type="radio" value="linux" checked>
            Linux
          </label>
        </li>
        <li>
          <label for="windows">
            <input id="windows" name="platform" type="radio" value="windows">
            Windows
          </label>
        </li>
      </ul>
    </fieldset>
    <fieldset>
      <legend>Server Disposition</legend>
      <ul>
        <li>
          <label for="shared">
            <input id="shared" name="server-disposition" type="radio" value="shared" checked>
            Shared
          </label>
        </li>
        <li>
          <label for="dedicated">
            <input id="dedicated" name="server-disposition" type="radio" value="dedicated">
            Dedicated
          </label>
        </li>
        <li>
          <label for="reseller">
            <input id="reseller" name="server-disposition" type="radio" value="reseller">
            Reseller
          </label>
        </li>
      </ul>
    </fieldset>
    I fail to see any problems with that (though the OP would undoubtely want to style it), and it facilitates precisely what the original post describes.


    Quote Originally Posted by gastongr
    [...] i'll try to make it server side as you suggested.
    You really have no choice. Relying on client-side validation to do the all work is practically begging for someone to submit false or erroneous data to you. For example, simply having client-side scripting disabled means that the user is unencumbered from any constraint you would like to enforce. Not even a type of control (like radio buttons or select elements) can provide security in a situation like that.

    Mike

  2. #12
    Join Date
    Mar 2006
    Location
    Illinois, USA
    Posts
    12,164
    Thanks
    265
    Thanked 690 Times in 678 Posts

    Default

    I'd totally go with radio buttons. It also wouldn't annoy people by "not letting them" click the other checkbox... they have to choose.

    Surely that's easier than disabling checkboxes.

    Maybe I'm missing something.

Bookmarks

Posting Permissions

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