In the Search page, your Web audience can either specify their own search criteria, submit a predefined search request that you specify, or submit a search request that is a combination of their own search criteria and a predefined request that you specify.
If you want your audience to be able to specify their own search criteria, set up input elements on the Search page. If you define a search request in advance, your Web audience can just click a button to start a search. If you want to combine search criteria that is specified by your audience with search criteria that you specify, your page comprises both types of elements: CDML tags that specify your predefined search criteria, and input elements where your audience can specify their own search criteria.
To build a Search page:
For this tag |
Specify the following information |
---|---|
-Db |
The filename of the database your pages refer to. This is a hidden entry. |
-Lay |
The name of the layout being accessed in the search. This is a hidden entry. |
-Format |
The filename of the page that is returned as a response to the search request a request. This is a hidden entry. |
-Error |
The filename of the page that is returned if an error occurs in processing the search request. This is a hidden entry. |
-Find |
The text on the button used in the browser to submit a search request. |
-FindAll |
The text on the button used in the browser to find all records in your database. |
-FindAny |
The text on the button used in the browser to find any (random) record in your database. |
You can add fields and choose the format for how they will appear in the Search page. Drag items from the Search Fields section of the Specifying search criteria entry in the FileMaker Form Library.
Note FileMaker container fields cannot be used to define a search request.
To use input elements from the FileMaker Form Library:
Drag this element to your page |
To use this format for the search field |
---|---|
Text field |
A text field form element. See Adding a text field for more information. |
Pop-up menu |
A pop-up menu or scrolling list form element.
|
Check box |
A check box form element. |
Radio buttons |
A radio button form element. |
Text area |
A text area form element. See Adding a text area for more information. |
Reset |
A button appearing in the browser. When clicked, this button resets all other input elements to their default values. See Adding a reset button. |
Some FileMaker fields in your database file might have a value list associated with them to facilitate data entry. Value lists from FileMaker can be used in your Search page.
To use FileMaker Pro value lists for check boxes and radio buttons:
Tip In the browser, the elements within the FMP-ValueList tag area (denoted by the box with the red border) repeat as many times as there are values in the value list. You can format the orientation of the elements in this tag, so that multiple values appear vertically in the browser by typing a carriage return character. Press Enter (or Shift-Enter for less white space between lines) on Windows; or press Return (or Shift-Return for less white space between lines) on Macintosh, immediately following the FMP-ValueListItem tag in the FMP-ValueList area.
To use FileMaker value lists for pop-up menus:
When making a search request in the FileMaker Pro database, your Web audience specifies their criteria in the fields on the Search page. Every field that is used for searching needs to have an associated rule or logic for how to search it. In addition, the entire find request must have a rule or logic for how it is processed in the FileMaker file. You can set up your Search form so that the logic for the search and fields is specified by your Web audience. You can also predefine the logic for both the fields and the search request itself, or combine logic that is specified by both you and your audience.
To set the logical operator for a search request:
For a search request whose logic will be specified by the Web audience, drag the two -LOp tags denoted by radio buttons into the FileMaker form area in the Search page.
To set the field comparison operator for each field in a search request:
Choose this field comparison operator |
To show these search results to your Web audience |
---|---|
Equals |
Records that match the search criteria exactly |
Contains |
Records that contain the character or string of characters specified in the search criteria |
Begins with |
Records that feature the character or string of characters featured in the search criteria at the beginning of a value |
Ends with |
Records with the character or string of characters featured in the search criteria at the end of a value |
Greater than |
Records with values greater than the search criteria |
Greater than or equals |
Records with values greater than or exactly equal to the search criteria values |
Less than |
Records with values less than the search criteria |
Less than or equals |
Records with values less than or exactly equal to the search criteria values |
Not equals |
All Records except those that match the search criteria |
For a search request whose field comparison operators will be specified by the Web audience, drag the field comparison pop-up menu element from the Specifying search criteria section in the library into the FileMaker form area in the Search page. The field comparison operator should appear immediately before the field with which you associate it.
You can specify whether you want the results of your search to be sorted or not and whether the Web viewer initiates the sort. You can also predefine a sort order or combine a predefined sort order with choices for sort order your audience makes before submitting a search request.
To specify the field that search results are sorted by:
To set up sorting options specified by your Web audience:
You can set the maximum number of records displayed in the Search Results Page, or you can allow your Web audience to choose a maximum from a pop-up list you add to the Search page.
To set the maximum number of records displayed in each Search Results page:
To allow your Web audience to determine the maximum number of records displayed in the Search Results page:
Once you have set up the fields and the options for searching and sorting, you can save and name the Search page. The name of the Search page should correspond to the filename used in all files that refer to it. For example, the Index page file named "index.htm" might refer to the Search page file called "search.htm."