Open fakeartist opened 7 years ago
Hi. I have a hidden input and another field. I want, depending of the hidden input's value, to show or hide the other field. I try to do it by using the code below, but it doesn't work. The other field is always hidden. Any ideas why?
$metaboxes->add_field(array( 'id' => 'hidden_field', 'type' => 'hidden', 'default' => '0', )); $metaboxes->add_field(array( 'name' => 'Hide me', 'id' => 'conditional_field', 'type' => 'text', 'attributes' => array( 'data-conditional-id' => 'hidden_field', 'data-conditional-value' => '0', ), ));
Hi. I have a hidden input and another field. I want, depending of the hidden input's value, to show or hide the other field. I try to do it by using the code below, but it doesn't work. The other field is always hidden. Any ideas why?