XF 2.3 How to set the default value to custom fields (checkbox to be checked)

jardob

Member
Hello, I have created a checkbox in the account details, with which I turn on one additional widget on the main page. This works for me. I originally wanted the checkbox to be checked, but I couldn't figure this out. Can someone advise me how to do it (if possible). I don't want to do it manually by writing to the database. I would prefer if it could be set somehow in the admin panel or in the template. This would solve both old and new users.
Thanks in advance for the advice.
 
Hello, I have created a checkbox in the account details, with which I turn on one additional widget on the main page. This works for me. I originally wanted the checkbox to be checked, but I couldn't figure this out. Can someone advise me how to do it (if possible). I don't want to do it manually by writing to the database. I would prefer if it could be set somehow in the admin panel or in the template. This would solve both old and new users.
Thanks in advance for the advice.
To leave the checkbox selected by default you have to add the checked attribute. For example:
Code:
<input type="checkbox" name="custom_fields[field_id]" value="1" checked="checked">
 
Back
Top Bottom