- This topic has 1 reply, 2 voices, and was last updated 9 years, 7 months ago by .
Viewing 2 posts - 1 through 2 (of 2 total)
Viewing 2 posts - 1 through 2 (of 2 total)
These forums are now closed and remain for historical purposes.
None of the content applies to the new version 3. For support, get in touch via our contact form.
Forums › Forums › Search & Filter Pro › Checkboxes default checked attribute
Tagged: checkboxes default status
Hi,
I would like to have the checkboxes’ checked attribute automatically set to ‘checked’, when opening the form. I use the following filter function :
function catcheck($input_object, $sfid)
{
if($input_object[‘attributes’][‘type’]==’checkbox’)
{
$input_object[‘attributes’][‘checked’]=’checked’;
}
return $input_object;
}
add_filter(‘sf_input_object_pre’, ‘catcheck’, 10, 2);
It does not work. In my various tests, I manage to act on the
Thanks for your help.
Olivier
I think it is your code that may need to be changed. Have a read of this, there are many other threads on StackExchange like it:
http://stackoverflow.com/questions/5270689/attrchecked-checked-does-not-work
WordPress uses jQuery 1.12.4