Logan Wells
Posts: 0
Joined: Sat Oct 11, 2014 12:37 am

How to register which checkboxes were selected/not selected to the DB?

Let's say we have some number of checkboxes, and the user is supposed to select some based on what they did, such as below:

What did you do today
[CHECKBOX ONE] Skateboarding
[CHECKBOX TWO] Walking
[CHECKBOX THREE] Running
(Button)

Of course we would want to see which checkboxes were selected and which were not selected (so in the DB it would say something like 'X was selected, Y was not')

How would you do this, it seems like it would be rather basic.

Thanks so much,
Logan

Emmz
Posts: 0
Joined: Sat Jun 23, 2012 11:06 pm

How to register which checkboxes were selected/not selected to the DB?

If your radiogroup is named: "checkboxgroup"
Add Run Javascript on "Value Changed" Event on "checkboxgroup"
code
//get checked radio VALUE
var radiochecked = $('input[name=checkboxgroup]:checked').val();
//OR
//get checked radio TEXT
var radiochecked = $('input[name=checkboxgroup]:checked').closest("div").find("label").text().trim();
/code

Logan Wells
Posts: 0
Joined: Sat Oct 11, 2014 12:37 am

How to register which checkboxes were selected/not selected to the DB?

@Howard
It is a popular question, it is weird how they do not have a tutorial for it.

@Neil B
Would I use this with any type of service?
Thanks

Return to “Issues”