title: Reset/Refresh Search Form Button in WordPress Theme
body: <p>First time posting. I appreciate any help in advance. I really appreciate it.</p>
  
  <p>I am currently work with a wordpress theme to search villas around the world and I would love to add a reset button that would clear the fields, drop downs and check boxes that are populated by a custom fields app. The normal reset button does not work and since I am teaching myself PHP on the fly I am at a loss. Here is the link to the page and I will paste some of the code so you get an idea of what I am looking at. </p>
  
  <p>I really appreciate any help since the theme author has been blowing me off.</p>
  
  <p><a href="http://villa1.froschft2.com/home-property-map/" rel="nofollow noreferrer">LINK</a></p>
  
  <p><div class="snippet" data-lang="js" data-hide="false" data-console="true" data-babel="false">
  <div class="snippet-code">
  <pre class="snippet-code-html lang-html prettyprint-override"><code>&lt;?php
   global $realty_theme_option, $wp_query;
  ?&gt;
  
  &lt;form class="property-search-form border-box" action="&lt;?php if ( tt_page_id_template_search() ) { echo get_permalink( tt_page_id_template_search() ); } ?&gt;"&gt;
  
   &lt;div class="row"&gt;
  
    &lt;?php if ( isset( $realty_theme_option['property-search-results-page'] ) &amp;&amp; empty( $realty_theme_option['property-search-results-page'] ) ) { ?&gt;
     &lt;div class="col-xs-12" style="margin-bottom: 1em"&gt;
      &lt;p class="alert alert-info"&gt;&lt;?php esc_html_e( 'Please go to "Appearance &gt; Theme Options &gt; Pages" and set the page you want to use as your property search results.', 'realty' ); ?&gt;&lt;/p&gt;
     &lt;/div&gt;
    &lt;?php } ?&gt;
  
    &lt;?php
     // Form select classes
     $form_select_class = 'form-control';
  
     if ( $realty_theme_option['enable-rtl-support'] || is_rtl() ) {
      $form_select_class .= ' chosen-select chosen-rtl';
     } else {
      $form_select_class .= ' chosen-select';
     }
  
     $acf_field_array = array();
  
     if ( isset( $realty_theme_option['property-search-features'] ) &amp;&amp; ! tt_is_array_empty( $realty_theme_option['property-search-features'] ) ) {
        $property_search_features = $realty_theme_option['property-search-features'];
     } else {
      $property_search_features = null;
     }
  
     $raw_search_params = get_query_var( 'property_search_parameters' );
     if ( ! tt_is_array_empty( $raw_search_params ) ) {
      $search_parameters = $raw_search_params;
     } else if ( isset( $realty_theme_option['property-search-parameter'] ) &amp;&amp; ! empty( $realty_theme_option['property-search-parameter'] ) ) {
      $search_parameters = $realty_theme_option['property-search-parameter'];
     } else {
      $search_parameters = null;
     }
  
     $raw_search_fields = get_query_var('property_search_fields');
     if ( ! tt_is_array_empty( $raw_search_fields ) ) {
      $search_fields = $raw_search_fields;
     } else if ( isset( $realty_theme_option['property-search-parameter'] ) &amp;&amp; ! empty( $realty_theme_option['property-search-parameter'] ) ) {
      $search_fields = $realty_theme_option['property-search-field'];
     } else {
      $search_fields = null;
     }
  
     $raw_search_labels = get_query_var('property_search_labels');
     if ( ! tt_is_array_empty( $raw_search_labels ) ) {
      $search_labels = $raw_search_labels;
     } else if ( isset( $realty_theme_option['property-search-label'] ) &amp;&amp; ! empty( $realty_theme_option['property-search-label'] ) ) {
      $search_labels = $realty_theme_option['property-search-label'];
     }  else {
      $search_labels = null;
     }
  
     $default_search_fields_array = array(
      'estate_search_by_keyword',
      'estate_property_id',
      'estate_property_location',
      'estate_property_type',
      'estate_property_status',
      'estate_property_price',
      'estate_property_price_min',
      'estate_property_price_max',
      'estate_property_pricerange',
      'estate_property_size',
      'estate_property_rooms',
      'estate_property_bedrooms',
      'estate_property_bathrooms',
      'estate_property_garages',
      'estate_property_available_from'
     );
  
     $i = 0;
  
     if ( isset( $search_form_columns ) &amp;&amp; ! empty( $search_form_columns ) ) {
      // Use $columns parameter from shortcode [property_search_form]
      $count_search_fields = $search_form_columns;
     } else {
      // No shortcode $columns found, pick columns according to total field count
      $count_search_fields = count( $search_fields );
     }
  
     if ( $count_search_fields == 1 ) {
      $columns = 'col-xs-12';
     } else if ( $count_search_fields == 2 ) {
      $columns = 'col-xs-12 col-sm-6';
     } else if ( $count_search_fields == 3 ) {
      $columns = 'col-xs-12 col-sm-6 col-md-4';
     } else {
      $columns = 'col-xs-12 col-sm-4 col-md-3';
     }
  
     if ( is_page_template( 'template-map-vertical.php' ) ) {
      $columns = 'col-xs-12 col-sm-6';
     }
  
     // Do we have any search parameters defined?
     if ( isset( $search_parameters ) &amp;&amp; ! empty( $search_parameters[0] ) ) {
  
      foreach ( $search_fields as $search_field ) {
  
       $search_parameter = $search_parameters[$i];
  
       // Check If Search Field Is Filled Out
       if ( ! empty( $search_field ) ) {
  
        // Default Property Field
        if ( in_array( $search_field, $default_search_fields_array ) ) {
  
         switch ( $search_field ) {
  
          case 'estate_search_by_keyword' :
          case 'estate_property_id' :
          ?&gt;
          &lt;div class="&lt;?php echo $columns; ?&gt; form-group"&gt;
           &lt;input type="text" name="&lt;?php echo $search_parameter; ?&gt;" id="&lt;?php echo $search_parameter; ?&gt;" value="&lt;?php echo isset( $_GET[$search_parameter]) ? $_GET[$search_parameter] : ''; ?&gt;" placeholder="&lt;?php echo $search_labels[$i]; ?&gt;" class="form-control" /&gt;
          &lt;/div&gt;
          &lt;?php
          break;
  
          case 'estate_property_location' : ?&gt;
          &lt;div class="&lt;?php echo $columns; ?&gt; form-group select"&gt;
           &lt;?php
            // http://wordpress.stackexchange.com/questions/14652/how-to-show-a-hierarchical-terms-list#answer-14658
            if ( ! empty( $search_labels[$i] ) ) {
             $search_label_location = $search_labels[$i];
            } else {
             $search_label_location = esc_html__( 'Any Location', 'realty' );
            }
           ?&gt;
           &lt;select name="&lt;?php echo $search_parameter; ?&gt;" id="&lt;?php echo $search_parameter; ?&gt;" class="&lt;?php echo esc_attr( $form_select_class ); ?&gt;"&gt;
            &lt;option value="all"&gt;&lt;?php echo $search_label_location; ?&gt;&lt;/option&gt;
              &lt;?php
               $location = get_terms('property-location', array(
                'orderby' =&gt; 'slug',
                'parent' =&gt; 0,
                'hide_empty' =&gt; false
               ) );
  
               if ( isset( $_GET[$search_parameter] ) ) {
              $get_location = $_GET[$search_parameter];
             } else {
              $get_location = null;
             }
            ?&gt;
  
              &lt;?php foreach ( $location as $key =&gt; $location ) : ?&gt;
                &lt;option value="&lt;?php echo $location-&gt;slug; ?&gt;" &lt;?php selected( $location-&gt;slug, $get_location ); ?&gt;&gt;
                   &lt;?php
                    echo $location-&gt;name;
  
                    $location2 = get_terms( 'property-location', array(
                     'orderby' =&gt; 'slug',
                     'parent' =&gt; $location-&gt;term_id
                    ) );
  
                    if ( $location2 ) :
                   ?&gt;
                   &lt;optgroup&gt;
                     &lt;?php foreach( $location2 as $key =&gt; $location2 ) : ?&gt;
                         &lt;option value="&lt;?php echo $location2-&gt;slug; ?&gt;" class="level2" &lt;?php selected( $location2-&gt;slug, $get_location ); ?&gt;&gt;
                          &lt;?php
                           echo $location2-&gt;name;
  
                           $location3 = get_terms( 'property-location', array(
                            'orderby' =&gt; 'slug',
                            'parent' =&gt; $location2-&gt;term_id
                           ) );
  
                           if ( $location3 ) :
                          ?&gt;
                          &lt;optgroup&gt;
                           &lt;?php foreach( $location3 as $key =&gt; $location3 ) : ?&gt;
                             &lt;option value="&lt;?php echo $location3-&gt;slug; ?&gt;" class="level3" &lt;?php selected( $location3-&gt;slug, $get_location ); ?&gt;&gt;
                             &lt;?php
                             echo $location3-&gt;name;
                             $location4 = get_terms( 'property-location', array( 'orderby' =&gt; 'slug', 'parent' =&gt; $location3-&gt;term_id ) );
                             if( $location4 ) :
                             ?&gt;
                             &lt;optgroup&gt;
                              &lt;?php foreach( $location4 as $key =&gt; $location4 ) : ?&gt;
                              &lt;option value="&lt;?php echo $location4-&gt;slug; ?&gt;" class="level4" &lt;?php selected( $location4-&gt;slug, $get_location ); ?&gt;&gt;
                    &lt;?php echo $location4-&gt;name; ?&gt;
                              &lt;/option&gt;
                              &lt;?php endforeach; ?&gt;
                             &lt;/optgroup&gt;
                             &lt;?php endif; ?&gt;
                             &lt;/option&gt;
                           &lt;?php endforeach; ?&gt;
                          &lt;/optgroup&gt;
                          &lt;?php endif; ?&gt;
                         &lt;/option&gt;
                     &lt;?php endforeach; ?&gt;
                   &lt;/optgroup&gt;
                   &lt;?php endif; ?&gt;
                &lt;/option&gt;
              &lt;?php endforeach; ?&gt;
           &lt;/select&gt;
          &lt;/div&gt;</code></pre>
  </div>
  </div>
  </p>