Sample Area Search Form
This page demonstrates how to create a search form that searches only the current web area. As you can see, there's very little coding for you to do.
- The only element that changes from one area to another is the text that appears on the submit button.
This search box only works for Drupal WebCMS content, because we know your current web area, the full name, and the contact us page for that area.
Two things to be aware of:
- The list of web areas is not updated in real time, so the there will be an overnight delay between when you create a web area, and when this code starts working for pages in that web area.
- This code only works for published pages on http://www2.epa.gov/, because we capture information from the referrer, and HTTPS pages do not transmit referrer.
<form action="http://search.epa.gov/epasearch/epasearch" method="get"> <div class="form-item form-type-textfield"> <label for="what-look">What are you looking for?</label> <input class="form-text" id="what-look" name="querytext" size="40" type="text" value="" /> <!-- do not edit the name attribute--> </div> <input class="form-submit" type="submit" value="Search Search Central" /> <!-- Edit to reflect your web area name --> <input name="typeofsearch" type="hidden" value="area" /> <!-- do not edit --> </form>