• Resolved yepezkjy18

    (@yepezkjy18)


    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)
  • Plugin Contributor Champ Camba

    (@champsupertramp)

    Hi @yepezkjy18

    Does the default value in Field settings couldn’t achieve this?

    Please try adding a default value in the Field settings.

    Regards,

    Plugin Contributor Champ Camba

    (@champsupertramp)

    Hi @yepezkjy18

    This thread has been inactive for a while so we’re going to go ahead and mark it Resolved.

    Please feel free to re-open this thread if any other questions come up and we’d be happy to help. ??

    Regards,

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.