title: PHP & CSS - Hide element if other field is filled in
body: <p>I'm editing a Dealer locator in Wordpress, and I need the modify a few fields. 
  I need to hide a field if the other field is filled in.</p>
  
  <p><strong>The scenario:</strong></p>
  
  <p>If the user fills in the Address field and leaves the Address2 field blank, The element Address shows. 
  I solved that part, but now i'm struggling with the next part. If the user fills in the Address2 field, it needs to show address2 and hide the Address</p>
  
  <p>The code i'm using right now:</p>
  
  <pre><code>function custom_listing_template() {
  
  global $wpsl, $wpsl_settings;
  
  $listing_template = '&lt;li class="my_change_list" data-store-id="&lt;%= id %&gt;"&gt;' . "\r\n";
  
  $listing_template .= "\t\t" . '&lt;div class="locator_wrap_left"&gt;' . "\r\n";
  $listing_template .= "\t\t" . '&lt;div class="locator_title"&gt;' . "\r\n";
  $listing_template .= "\t\t\t\t" . wpsl_store_header_template( 'listing' ) . "\r\n";
  $listing_template .= "\t\t" . '&lt;/div&gt;' . "\r\n";
  $listing_template .= "\t\t" . '&lt;div class="locator_left"&gt;' . "\r\n";
  $listing_template .= "\t\t\t" . '&lt;p&gt;&lt;%= thumb %&gt;' . "\r\n";
  
  $listing_template .= "\t\t\t\t" . '&lt;span class="wpsl-street street1"&gt;&lt;%= address %&gt;&lt;/span&gt;' . "\r\n";
  $listing_template .= "\t\t\t\t" . '&lt;% if (address2) {  %&gt;' . "\r\n";
  $listing_template .= "\t\t\t\t" . ' &lt;span class="wpsl-street street2"&gt;&lt;%= address2 %&gt;&lt;/span&gt;' . "\r\n";
  $listing_template .= "\t\t\t\t" . '&lt;% } %&gt;' . "\r\n";
  $listing_template .= "\t\t\t\t" . '&lt;span&gt;' . wpsl_address_format_placeholders() . '&lt;/span&gt;' . "\r\n";
  $listing_template .= "\t\t\t\t" . '&lt;span class="wpsl-country"&gt;&lt;%= country %&gt;&lt;/span&gt;' . "\r\n";
  $listing_template .= "\t\t\t" . '&lt;/p&gt;' . "\r\n";
  $listing_template .= "\t\t" . '&lt;/div&gt;' . "\r\n";
  </code></pre>
  
  <p>I tried the following but it doesn't seem to help!</p>
  
  <pre><code>document.getElementById('street1').style.display = 'none';
  </code></pre>
  
  <p><strong>EDIT</strong>: I'm trying to Avoid javascript right now since it's a PHP file. </p>