Conditionally Displaying Form Fields

Article Last Updated: February 23, 2016

You can conditionally display form fields based on other form field values. In the field below, we are conditionally displaying a field when a drop down is changed to ‘Other’.

You’ll notice that we are hooking into `yikes-mailchimp-shortcode-enqueue-scripts-styles` to ensure our script is loaded wherever our form is being displayed.

/**
*	Conditionally display MMERGE5 (text input field) field when MMERGE4 (a dropdown) is set to 'Other'
*	@Example Snippet
*/
function conditional_show_hide_yikes_mailchimp_field( $form_id ) {
  ?>