<div class="find-nearest">
  <form method="post" id="local-locator-form" class="find-location-for-<%= format %>">
    <fieldset>
      <legend class="visuallyhidden">Postcode lookup</legend>
      <% if @edition %>
        <input type="hidden" name="edition" value="<%= @edition %>">
      <% end %>

      <% if @location_error %>
      <div class="location_error error-notification"><%= t @location_error %></div>
      <% elsif params[:postcode] and @publication.places.nil? %>
      <div class="location_error error-notification">Please enter a valid full UK postcode.</div>
      <% end %>

      <div class="ask_location">
        <label for="postcode">Enter your postcode (UK only) <input class="postcode" id="postcode" name="postcode" type="text" placeholder="eg SW1A 2AA" value="<%= @postcode %>"></label>
        <button type="submit" class="button">Find</button>
      </div>
    </fieldset>
  </form>
</div>

<div class="find-nearest">
  <form method="post" id="local-locator-form" class="find-location-for-<%= format %>">
    <fieldset>
      <legend class="visuallyhidden">Postcode lookup</legend>
      <% if @edition %>
        <input type="hidden" name="edition" value="<%= @edition %>">
      <% end %>

      <% if @location_error %>
        <div class="location_error error-notification"><%= t @location_error %></div>
      <% elsif params[:postcode] and @publication.places.nil? %>
        <div class="location_error error-notification">Please enter a valid full UK postcode.</div>
      <% end %>

      <div class="ask_location">
        <label for="postcode">Enter your postcode (UK only) <input class="postcode" id="postcode" name="postcode" type="text" placeholder="eg SW1A 2AA" value="<%= @postcode %>"></label>
        <button type="submit" class="button">Find</button>
        <div>
          <%= link_to "Find a postcode on Royal Mail's postcode finder",
                      'http://www.royalmail.com/find-a-postcode',
                      :target => "_blank",
                      id: 'postcode-finder-link',
                      rel: "external" %>
        </div>
      </div>
    </fieldset>
  </form>
</div>

Add postcode finder link to view
Add postcode finder link to view

Postcode Finder opens in new tab as not to close the current page. Exit link tracking is being provided by `static` app's inclusion of govuk_frontend_toolkit
