sahostking Posted October 27, 2019 Share Posted October 27, 2019 Hi, how can I set client custom field, type: tick box with default value of checked on a registration form? Thanks 0 Quote Link to comment Share on other sites More sharing options...
brian! Posted October 28, 2019 Share Posted October 28, 2019 23 hours ago, sahostking said: how can I set client custom field, type: tick box with default value of checked on a registration form? at least three immediate ways spring to mind - a ClientAreaPageRegister hook, a ClientAreaFooterOutput hook or you could edit the clientregister.tpl template... as an example, let's use the Footer hook option... <?php # Auto-Enable Registration Checkbox Hook # Written by brian! function auto_check_checkbox_hook($vars) { if ($vars['templatefile'] == 'clientregister') { return <<<HTML <script>$('#customfieldXXX').prop('checked', true);</script> HTML; } } add_hook("ClientAreaFooterOutput", 1, "auto_check_checkbox_hook"); you will need to find the ID value of the checkbox field that you want to autocheck (the easiest way would probably be by viewing the source output in the browser) and then replace XXX in the hook with that ID value... possibly for you, it might be 1145 - but you'll know which field you're referring to better than me! 🙂 0 Quote Link to comment Share on other sites More sharing options...
sahostking Posted October 29, 2019 Author Share Posted October 29, 2019 Awesome it worked perfectly. Thank You 0 Quote Link to comment Share on other sites More sharing options...
DongTL Posted October 16, 2021 Share Posted October 16, 2021 How about admin area? I want the custom field is checked by default when creating new client on admin. Thank you, 0 Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.