• Resolved ferrywortel

    (@ferrywortel)


    Dear all,
    I am trying to make a function within the Contact Form 7 plugin that gives users different question based on which checkbox they highlight.

    I am using the following checkbox element within contact form 7.

    <label> <b>Applications</b> </label>
    [checkbox checkbox-945 use_label_element "Propulsion and Stabilization?" "Transit Systems?" "Bearing and Sealing?" "Mooring" "Lighting"]

    I want the function to do something along the lines of this:
    If checkbox “Propulsion and Stabilization” is checked display question 1 and 2.
    If checkbox “Transit Systems” is checked display question 3 and 4.
    If checkboxes “Propulsion and Stabilization” and “Transit Systems” are checked display question 1,2,3 and 4.

    I have started writing something with the help of stackoverflow but couldn’t figure out where to add my own variables instead of the given variables that are displayed.

    add_action('init', 'Checkbox');
    function Checkbox() {
      $options = get_option( 'creative_settings' );
    
      // If is checked, activate function to display coming soon page
      if( $options['creative_checkbox_field_1'] == '1' ) { 
          add_action('get_header', 'coming_soon_mode');
      } 
      else { 
          //do nothing
      }
      return;
    }

    Any help is appreciated

    • This topic was modified 4 years, 8 months ago by ferrywortel.
Viewing 1 replies (of 1 total)
Viewing 1 replies (of 1 total)
  • The topic ‘Contact Form 7 Checkbox Function’ is closed to new replies.