- Dreamweaver User Guide
- Introduction
- Dreamweaver and Creative Cloud
- Dreamweaver workspaces and views
- Set up sites
- About Dreamweaver sites
- Set up a local version of your site
- Connect to a publishing server
- Set up a testing server
- Import and export Dreamweaver site settings
- Bring existing websites from a remote server to your local site root
- Accessibility features in Dreamweaver
- Advanced settings
- Set site preferences for transferring files
- Specify proxy server settings in Dreamweaver
- Synchronize Dreamweaver settings with Creative Cloud
- Using Git in Dreamweaver
- Manage files
- Create and open files
- Manage files and folders
- Getting and putting files to and from your server
- Check in and check out files
- Synchronize files
- Compare files for differences
- Cloak files and folders in your Dreamweaver site
- Enable Design Notes for Dreamweaver sites
- Preventing potential Gatekeeper exploit
- Layout and design
- CSS
- Understand Cascading Style Sheets
- Laying out pages using CSS Designer
- Using CSS preprocessors in Dreamweaver
- How to set CSS Style preferences in Dreamweaver
- Move CSS rules in Dreamweaver
- Convert inline CSS to a CSS rule in Dreamweaver
- Work with div tags
- Apply gradients to background
- Create and edit CSS3 transition effects in Dreamweaver
- Format code
- Page content and assets
- Set page properties
- Set CSS heading properties and CSS link properties
- Work with text
- Find and replace text, tags, and attributes
- DOM panel
- Edit in Live View
- Encoding documents in Dreamweaver
- Select and view elements in the Document window
- Set text properties in the Property inspector
- Spell check a web page
- Using horizontal rules in Dreamweaver
- Add and modify font combinations in Dreamweaver
- Work with assets
- Insert and update dates in Dreamweaver
- Create and manage favorite assets in Dreamweaver
- Insert and edit images in Dreamweaver
- Add media objects
- Adding videos in Dreamweaver
- Insert HTML5 video
- Insert SWF files
- Add audio effects
- Insert HTML5 audio in Dreamweaver
- Work with library items
- Using Arabic and Hebrew text in Dreamweaver
- Linking and navigation
- jQuery widgets and effects
- Coding websites
- About coding in Dreamweaver
- Coding environment in Dreamweaver
- Set coding preferences
- Customize code coloring
- Write and edit code
- Code hinting and code completion
- Collapse and expand code
- Reuse code with snippets
- Lint code
- Optimize code
- Edit code in Design view
- Work with head content for pages
- Insert server-side includes in Dreamweaver
- Using tag libraries in Dreamweaver
- Importing custom tags into Dreamweaver
- Use JavaScript behaviors (general instructions)
- Apply built-in JavaScript behaviors
- About XML and XSLT
- Perform server-side XSL transformations in Dreamweaver
- Performing client-side XSL transformations in Dreamweaver
- Add character entities for XSLT in Dreamweaver
- Format code
- Cross-product workflows
- Installing and using extensions to Dreamweaver
- In-App updates in Dreamweaver
- Insert Microsoft Office documents in Dreamweaver (Windows only)
- Working with Fireworks and Dreamweaver
- Edit content in Dreamweaver sites using Contribute
- Dreamweaver-Business Catalyst integration
- Create personalized email campaigns
- Templates
- About Dreamweaver templates
- Recognizing templates and template-based documents
- Create a Dreamweaver template
- Create editable regions in templates
- Create repeating regions and tables in Dreamweaver
- Use optional regions in templates
- Define editable tag attributes in Dreamweaver
- How to create nested templates in Dreamweaver
- Edit, update, and delete templates
- Export and import xml content in Dreamweaver
- Apply or remove a template from an existing document
- Edit content in Dreamweaver templates
- Syntax rules for template tags in Dreamweaver
- Set highlighting preferences for template regions
- Benefits of using templates in Dreamweaver
- Mobile and multiscreen
- Dynamic sites, pages and web forms
- Understand web applications
- Set up your computer for application development
- Troubleshoot database connections
- Removing connection scripts in Dreamweaver
- Design dynamic pages
- Dynamic content sources overview
- Define sources of dynamic content
- Add dynamic content to pages
- Changing dynamic content in Dreamweaver
- Display database records
- Provide and troubleshoot live data in Dreamweaver
- Add custom server behaviors in Dreamweaver
- Building forms using Dreamweaver
- Use forms to collect information from users
- Create and enable ColdFusion forms in Dreamweaver
- Create web forms
- Enhanced HTML5 support for form elements
- Develop a form using Dreamweaver
- Building applications visually
- Build master and detail pages in Dreamweaver
- Build search and results pages
- Build a record insert page
- Build an update record page in Dreamweaver
- Building record delete pages in Dreamweaver
- Use ASP commands to modify database in Dreamweaver
- Build a registration page
- Build a login page
- Build a page that only authorized users can access
- Securing folders in Coldfusion using Dreamweaver
- Using ColdFusion components in Dreamweaver
- Test, preview, and publish websites
- Troubleshooting
The user interface has been simplified in Dreamweaver and later. As a result, you may not find some of the options described in this article in Dreamweaver 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.
-
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.
-
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.
-
Add a Submit button to the form (Insert > Form > Button).
-
(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.
-
Select the form by selecting the <form> tag in the tag selector at the bottom of the Document window, as the following image shows:
-
In the Action box in the form’s Property inspector, enter the filename of the results page that will conduct the database search.
-
In the Method pop‑up menu, select one of the following methods to determine how the form sends data to the server:
GET sends the form data by appending it to the URL as a query string. Because URLs are limited to 8192 characters, don’t use the GET method with long forms.
POST sends the form data in the body of a message.
Default uses the browser’s default method (usually GET).
The search page is done.
Build a basic results page
When the user clicks the form’s Search button, the search parameters are sent to a results page on the server. The results page on the server, not the search page on the browser, is responsible for retrieving records from the database. If the search page submits a single search parameter to the server, you can build the results page without SQL queries and variables. You create a basic recordset with a filter that excludes records that don’t meet the search parameter submitted by the search page.
If you have more than one search condition, you must use the advanced Recordset dialog box to define your recordset (see Build an advanced results page ).
Create the recordset to hold the search results
-
Open your results page in the Document window.
If you don’t have a results page yet, create a blank dynamic page (File > New > Blank Page).
-
Create a recordset by opening the Bindings panel (Window > Bindings), clicking the Plus (+) button, and selecting Recordset from the pop‑up menu.
-
Make sure the simple Recordset dialog box appears.Märkus.
If the advanced dialog box appears instead, switch to the simple dialog box by clicking the Simple button.
-
Enter a name for the recordset, and select a connection.
The connection should be to a database containing data you want the user to search.
-
In the Table pop‑up menu, select the table to be searched in the database.Märkus.
In a single-parameter search, you can search for records in only a single table. To search more than one table at a time, you must use the advanced Recordset dialog box and define a SQL query.
-
To include only some of the table’s columns in the recordset, click Selected and select the desired columns by Control‑clicking (Windows) or Command-clicking (Macintosh) them in the list.
You should include only the columns containing information you want to display on the results page.
Leave the Recordset dialog box open for now. You’ll use it next to retrieve the parameters sent by the search page and create a recordset filter to exclude records that don’t meet the parameters.
Create the recordset filter
-
From the first pop‑up menu in the Filter area, select a column in the database table in which to search for a match.
For example, if the value sent by the search page is a city name, select the column in your table that contains city names.
-
From the pop‑up menu beside the first menu, select the equal sign (it should be the default).
-
From the third pop‑up menu, select Form Variable if the form on your search page uses the POST method, or URL Parameter if it uses the GET method.
The search page uses either a form variable or a URL parameter to pass information to the results page.
-
In the fourth box, enter the name of the form object that accepts the search parameter on the search page.
The name of the object doubles as the name of the form variable or URL parameter. You can get the name by switching to the search page, clicking the form object on the form to select it, and checking the object’s name in the Property inspector.
For example, suppose you want to create a recordset that includes only adventure trips to a specific country. Assume you have a column in the table called TRIPLOCATION. Also assume the HTML form on your search page uses the GET method and contains a menu object called Location that displays a list of countries. The following example shows how your Filter section should look:
-
(Optional) Click Test, enter a test value, and click OK to connect to the database and create an instance of the recordset.
The test value simulates the value that would otherwise have been returned from the search page. Click OK to close the test recordset.
-
If you’re satisfied with the recordset, click OK.
A server-side script is inserted on your page that checks each record in the database table when it runs on the server. If the specified field in a record meets the filtering condition, the record is included in a recordset. The script builds a recordset that contains only the search results.
The next step is to display the recordset on the results page. For more information, see Display the search results .
Build an advanced results page
If the search page submits more than one search parameter to the server, you must write a SQL query for the results page and use the search parameters in SQL variables.
If you have only one search condition, you can use the simple Recordset dialog box to define your recordset (see Build a basic results page ).
-
Open the results page in Dreamweaver, and then create a recordset by opening the Bindings panel (Window > Bindings), clicking the Plus (+) button, and selecting Recordset from the pop‑up menu.
-
Make sure the advanced Recordset dialog box appears.
The advanced dialog box has a text area to enter SQL statements. If the simple dialog box appears instead, switch to the advanced dialog box by clicking the Advanced button.
-
Enter a name for the recordset, and select a connection.
The connection should be to a database containing data you want the user to search.
-
Enter a Select statement in the SQL text area.
Make sure the statement includes a WHERE clause with variables to hold the search parameters. In the following example, the variables are called varLastName and varDept:
SELECT EMPLOYEEID, FIRSTNAME, LASTNAME, DEPARTMENT, EXTENSION FROM EMPLOYEE ¬ WHERE LASTNAME LIKE 'varLastName' ¬ AND DEPARTMENT LIKE 'varDept'
To reduce the amount of typing, you can use the tree of database items at the bottom of the advanced Recordset dialog box. For instructions, see Define an advanced recordset by writing SQL.
For help on SQL syntax, see the SQL primer at www.adobe.com/go/learn_dw_sqlprimer.
-
Give the SQL variables the values of the search parameters by clicking the Plus (+) button in the Variables area and entering the variable’s name, default value (the value the variable should take if no run-time value is returned), and run-time value (usually a server object holding a value sent by a browser, such as a request variable).
In the following ASP example, the HTML form on the search page uses the GET method and contains one text field called LastName and another called Department:
In ColdFusion, the run-time values would be #LastName# and #Department#. In PHP, the run-time values would be $_REQUEST["LastName"] and $_REQUEST["Department"].
-
(Optional) Click Test to create an instance of the recordset using the default variable values.
The default values simulate the values that would otherwise have been returned from the search page. Click OK to close the test recordset.
-
If you’re satisfied with the recordset, click OK.
The SQL query is inserted in your page.
The next step is to display the recordset on the results page.
Display the search results
After creating a recordset to hold the search results, you must display the information on the results page. Displaying the records can be a simple matter of dragging individual columns from the Bindings panel to the results page. You can add navigation links to move forward and backward through the recordset, or you can create a repeating region to display more than one record on the page. You can also add links to a detail page.
For more information on methods of displaying dynamic content on a page other than displaying results in a dynamic table, see Displaying database records.
-
Place the insertion point where you want the dynamic table to appear on the results page, and select Insert > Data Objects > Dynamic Data > Dynamic Table.
-
Complete the Dynamic Table dialog box, selecting the recordset you defined to hold the search results.
-
Click OK. A dynamic table that displays search results is inserted on the results page.
Create a detail page for a results page
Your set of search and results pages can include a detail page to display more information about specific records on the results page. In this situation, your results page also doubles as the master page in a master-detail page set.
Create a link to open a related page (ASP)
You can create a link that opens a related page and that passes existing parameters to that page. The server behavior is only available when using the ASP server model.
Before adding a Go To Related Page server behavior to a page, make sure the page receives form or URL parameters from another page. The job of the server behavior is to pass these parameters to a third page. For example, you can pass search parameters received by a results page to another page and save the user from entering the search parameters again.
Also, you can select text or an image on the page to serve as the link to the related page, or you can position your pointer on the page without selecting anything, and the link text is inserted.
-
In the Go To Related Page box, click Browse and locate the related page file.
If the current page submits data to itself, enter the current page’s file name.
-
If the parameters you want to pass were received directly from an HTML form using the GET method, or are listed in the page’s URL, select the URL Parameters option.
-
If the parameters you want to pass were received directly from an HTML form using the POST method, select the Form Parameters option.
-
Click OK.
When the new link is clicked, the page passes the parameters to the related page using a query string.