Home > Fluid Dynamics Search Engine > Help > 1071

Advanced Search: Selecting Realms by name

By default, visitors can select either "All" realms, or a single named realm.

Default Form

Terms:

Select realm:

In some cases, visitors may want to search multiple realms, but not all, as shown here:

Advanced Form

Terms:

Search these realms:

Help
Forum
Other

To allow your visitors this option, code your search form as follows:

<p>Terms: <input name="Terms" /></p>

<p>Search these realms:</p>

<p>
	<input type="hidden" name="Realm" value="include-by-name" />
	<input type="checkbox" name="Realm:Help" value="1" checked="checked" /> Help<br />
	<input type="checkbox" name="Realm:Forum" value="1" /> Forum<br />
	<input type="checkbox" name="Realm:Site" value="1" /> Other
</p>

Specifically, use a hidden value of "include-by-name" for the "Realm" value, and then create a series of checkboxes with names of "Realm:realm-name" for each "realm-name" that you want to make available. These HTML FORM constructs would replace the "Realm" select box in the default search form. Remember that realm names are case sensitive.

The value of "Realm" will override the "Realm:realm-name" settings. A composite HTML FORM can be constructed which exposes both of these controls to visitor interaction. In the example below, if the first radio button is selected, then the values of the final checkboxes will be ignored, since "Realm=All" takes precedence:

Advanced^2 Form

Terms:

Search all realms.
Search only these realms:

Help
Forum
Other

<p>Terms: <input name="Terms" /></p>

<p><input type="radio" name="Realm" value="All" /> Search all realms.<br />
<input type="radio" name="Realm" value="include-by-name" checked="checked" />
Search only these realms:</p>

<blockquote>
	<p><input type="checkbox" name="Realm:Help" value="1" checked="checked" /> Help<br />
	<input type="checkbox" name="Realm:Forum" value="1" /> Forum<br />
	<input type="checkbox" name="Realm:Site" value="1" /> Other</p>
</blockquote>

Applies to FDSE version 2.0.0.0042 and newer.


    "Advanced Search: Selecting Realms by name"
    http://www.xav.com/scripts/search/help/1071.html