beautypg.com

Building search and results pages – Adobe Dreamweaver CC 2014 v.13 User Manual

Page 585

background image

Building search and results pages

To the top

To the top

About search and results pages
Build the search page
Build a basic results page
Build an advanced results page
Display the search results
Create a detail page for a results page
Create a link to open a related page (ASP)

Note: The user interface has been simplified in Dreamweaver CC and later. As a result, you may not find some of the options described in this
article in Dreamweaver CC and later. For more information, see

this article

.

About search and results pages

You can use Dreamweaver to build a set of pages to let users search your database and view the search results.

In most cases, you need at least two pages to add this feature to your web application. The first page is a page that contains an HTML form in
which users enter search parameters. Although this page doesn’t do any actual searching, it is referred to as the search page.

The second page you need is the results page, which performs most of the work. The result’s page does the following tasks:

Reads the search parameters submitted by the search page

Connects to the database and searches for records

Builds a recordset with the records found

Displays the contents of the recordset

Optionally, you can add a detail page. A detail page gives users more information about a particular record on the results page.

If you have only one search parameter, Dreamweaver lets you add search capabilities to your web application without using SQL queries and
variables. Simply design your pages and complete a few dialog boxes. If you have more than one search parameter, you need to write a
SQL statement and define multiple variables for it.

Dreamweaver inserts the SQL query in your page. When the page runs on the server, each record in the database table is checked. If the
specified field in a record meets your SQL query conditions, the record is included in a recordset. The SQL query in effect builds a recordset
containing only the search results.

For example, field sales staff might have information about customers in a certain area who have incomes above a certain level. In a form on
a search page, the sales associate enters a geographical area and a minimum income level, and then clicks the Submit button to send the
two values to a server. On the server, the values are passed to the results page’s SQL statement, which then creates a recordset containing
only customers in the specified area with incomes above the specified level.

Build the search page

A search page on the web typically contains form fields in which the user enters search parameters. At minimum, your search page must have an
HTML form with a Submit button.

To add an HTML form to a search page, complete the following procedure.

1. Open the search page or a new page, and select Insert > Form > Form.

An empty form is created on the page. You might need to enable Invisible Elements (View > Visual Aids > Invisible Elements) to see the
form’s boundaries, which are represented by thin red lines.

2. Add form objects for users to enter their search parameters by selecting Form from the Insert menu.

Form objects include text fields, menus, options, and radio buttons. You can add as many form objects as you want to help users refine their
searches. However, keep in mind that the greater the number of search parameters on the search page, the more complex your SQL
statement will be.

3. Add a Submit button to the form (Insert > Form > Button).

4. (Optional) Change the label of the Submit button by selecting the button, opening the Property inspector (Window > Properties), and entering

a new value in the Value box.

Next, you’ll tell the form where to send the search parameters when the user clicks the Submit button.

578

This manual is related to the following products: