Edit value on field after select a option on Checkbox
-
Hello friends, I need help with the ultimate member hooks.
I have a checkbox with 2 options “yes and not” on my registration form. I need that when people select No, a text field with a default value is automatically filled in.
I was creating a function with the hooks, but I couldn’t achieve it, here more or less what I was doing:
add_filter( ‘um_edit_{$key}_field_value’, ‘my_edit_field_value’, 10, 2 );
function my_edit_field_value( $args ) {
if($args[‘Checkbox_field’]==’No’){
$value = ‘default-text’;
$args[‘Text_field’]= $value;
}}
Viewing 2 replies - 1 through 2 (of 2 total)
Viewing 2 replies - 1 through 2 (of 2 total)
- The topic ‘Edit value on field after select a option on Checkbox’ is closed to new replies.