Reputation: 11
I have 2 checkboxs from the same column, one for Eat and another one for Drink, I plan if user check Eat, it will save as Eat data in 'a_type' column in database, same goes with Drink. In additional the user also able to check both Eat and Drink checkboxs and saved as Both in database , My problem now I can't check both, I only can check one of its
Upvotes: 1
Views: 1669
Reputation: 970
Use a radio button with three choices: Eat, Drink, Eat & Drink.
Upvotes: 2
Reputation: 11465
If you associated 2 different values to the checkboxes, it is normal that when clicking on one of the checkboxes the other unckeck. Each checkbox has a dedicated value and when you click one, it will set the column to its value and the second box will uncheck due to that same value change. You won't be able to check directly both boxes that way.
If you absolutely want to keep 2 checkboxes linked to the same column, you could add two computed fields with the apparence of a checkbox based on your column for the display part, and handle the clicked
event to modify that column by code.
Upvotes: 1