Jump to content

client custom field default checked


sahostking

Recommended Posts

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! 🙂

Link to comment
Share on other sites

  • 1 year later...

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use & Guidelines and understand your posts will initially be pre-moderated