This thread is over two years old and may be outdated. Please create a new thread if you need help, or email us if you have an active Premium license.

State Emitter for Checkboxes?

6 years ago · Last reply by Alex S 6 years ago

Hey my friends,

i have some field which only be activ if a checkbox field is true.

how should i create this hide/show state emitter and state handler?

'a4newreadlessmore_desk_tab_unfolded' => array(
	            'type' => 'checkbox',
	            'label' => __('entfalteter Text im Desktop und Tablet', 'so-widgets-bundle'),
				'default' => false,
				'state_emitter' => array(
					'callback' => 'conditional',
					'args' => array( 'a4newreadlessmore_desk_tab_unfolded' )
				),
            ),
'a4newreadlessmore_desk_tab_height' => array(
                'type' => 'number',
                'label' => __('Height für Desktop und Tablet', 'so-widgets-bundle'),
                'description'   =>  'nur Höhe in Pixelanzahl wie 300',
'state_handler' => array(
'a4newreadlessmore_desk_tab_unfolded' => array('show')
)
            ),

This is our free support forum. Replies can take several days.

Need fast email support? Get SiteOrigin Premium

Replies

1
  1. Alex S Staff 6 years, 11 months ago

    Hi Sam,

    You should set a state based on the value of the field. You can see an example of this in the Conditional Callback example and in the SiteOrigin Hero widget.

Replies on this thread are closed.

Please create a new thread if you have a question, or purchase a SiteOrigin Premium license if you need one-on-one email support.

Have a different question or issue?

Start New Thread