How to see if checkbox has been checked in PHP

You can use rgpost but you do have to access each checkbox choice/input separately. For example, if your checkbox field id is 2 you would access its input values like so:

$choice1 = rgpost( 'input_2_1' );
$choice2 = rgpost( 'input_2_2' );

$choice1 will contain the choice value when selected and will be empty when not selected.

1 Like