Gravity Perks – Gravity Forms Limit Checkboxes
$6.00
How do I install this snippet of code?
Just copy and paste the code into your theme’s functions.php file.
Do I need to change this snippet in order to make it work with my form
This snippet now uses the class format. This makes it easier to use on multiple forms. This class can be instantiated by knowing the form ID, fieldID and minimum/maximum number checkboxes that should be allowed/enforced in each field. It will look like this:
New GFLimitCheckboxes(123, array(
5 => array(
'min' => 2,
'max' => 3,
),
));
In the template form:
New GFLimitCheckboxes(FORM_ID, array(
FIELD_ID => array(
'min' => MIN_NUMBER,
'max' => MAX_NUMBER,
),
));
Multiple checkbox fields can be specified on a particular form, such as:
New GFLimitCheckboxes(123, array(
5 => array(
'min' => 2,
'max' => 3,
),
13 => array(
'max' => 3,
),
));
You can also apply this functionality to multiple forms.
New GFLimitCheckboxes(123, array(
5 => array(
'min' => 2,
'max' => 3,
),
13 => array(
'max' => 3,
),
));
New GFLimitCheckboxes(321, array(
1 => array(
'max' => 4,
),
));
And that’s it!
There are no reviews yet.