Posts: 2,536
Location: Western Maryland
|
Lothop,
I am not entirely clear on your question. Firstly, radio buttons are by definition selectable only one at a time within a logical group. Their very name comes from the old manual preset buttons so common on car radios up until the early 1980's.
Assuming you mean checkboxes or some other means of specifying more than one value, let me try to restate your problem. With two values, you wish to be able to communicate, in one field that the user may have selected one option (we'll call the value for that option 1), another option (2), both or none. It's a common problem and programmers will normally approach it in one of several ways.
First, you could simply store off a comma-delimited list of the values selected. So if the user selected both, you would store "1,2" in the field.
Another option would be to assign numeric values to each option that are a power of 2. So option 1 would be 1, option 2 would be 2, option 3 would be 4, option 4 would be 8, then 16, 32, 64, etc. In this way, you could add all the values together and store that one numeric value from which could be deduced all the options selected. For example, if I store off a value of 11, I know a user must have selected a combination of options carrying the values of 1,2 and 8. That is the only combination of such values arriving at the sum of 11. It is really a matter of personal choice you wish to take.
__________________
—Kyrnt
|