Limiting Number of Checkboxes

Ask a Question related to Coldfusion - Advanced Techniques, Design and Development.

  1. #1

    Default Limiting Number of Checkboxes

    I am hoping someone can help with this. I am running a query which selects all
    members of staff. This is then output to a form with checkboxes assigned with a
    delimiter and the staff id as the name of the checkbox (ie - MOD_#staff_id#).

    I want to be able to select ONLY ONE checkbox from the entire form (there are
    only about 10 records in the table) and RESTRICT ALL OTHERS from being selected
    once a checkbox has been marked off. In other words, once you select a checkbox
    you should not be able to select anything else unless you clear the one you
    previously selected, or ideally if you select more than one it automatically
    clears the previously selected box.

    Any help will be appreciated.

    blkcop Guest

  2. Similar Questions and Discussions

    1. limiting the number of copies printable from a PDF
      Is it possible to set a limit on the number of copies printable from a PDF file for proprietary material?
    2. Limiting number of control instances?
      Hey all, Is there a way of limiting the number of instances of a server control that the user can put on a form? I'm writing an interfaceless...
    3. limiting the number of records returned
      Hi all, The problem I am having is that I built an online query system. The problem is if the search critera is to open or loose, the coldfusion...
    4. sort from the smallest number to the highest number
      Hi Just say I want to sort the row by using the fifth column data as reference from the smallest the largest number, if using sort, It will give...
    5. Huge number of checkboxes to be populated from database
      I have a database with 90-odd true-false values that I need to display on a webform as checkboxes. There are also some other values (numbers and...
  3. #2

    Default Re: Limiting Number of Checkboxes

    blkcop a écrit :
    > I am hoping someone can help with this. I am running a query which selects all
    > members of staff. This is then output to a form with checkboxes assigned with a
    > delimiter and the staff id as the name of the checkbox (ie - MOD_#staff_id#).
    >
    > I want to be able to select ONLY ONE checkbox from the entire form (there are
    > only about 10 records in the table) and RESTRICT ALL OTHERS from being selected
    > once a checkbox has been marked off. In other words, once you select a checkbox
    > you should not be able to select anything else unless you clear the one you
    > previously selected, or ideally if you select more than one it automatically
    > clears the previously selected box.
    >
    > Any help will be appreciated.
    >
    Hello,

    Maybe you can use radio against chekbox ?
    Else you can do that with javascript...

    Sorry for my bad english

    JB
    Jibé Guest

  4. #3

    Default Re: Limiting Number of Checkboxes

    I agree with JB's suggestion. If you only want the user to be able to make one
    selection, use radio buttons. Just make sure to give all of the buttons the
    same name.





    <form ...(your form settings)...>
    <!--- radio button example: user will only be allowed to select one option
    --->
    <input type="radio" name="member_id" value="1" checked> Staff Member 1<br>
    <input type="radio" name="member_id" value="2"> Staff Member 2<br>
    <input type="radio" name="member_id" value="3"> Staff Member 3<br>
    <input type="radio" name="member_id" value="4"> Staff Member 4<br>
    <input type="radio" name="member_id" value="5"> Staff Member 5<br>
    <input type="radio" name="member_id" value="6"> Staff Member 6<br>
    <input type="radio" name="member_id" value="7"> Staff Member 7<br>
    <input type="radio" name="member_id" value="8"> Staff Member 8<br>
    <input type="radio" name="member_id" value="9"> Staff Member 9<br>
    <input type="radio" name="member_id" value="10"> Staff Member 10<br>
    </form>

    mxstu 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