Once you've completed a page, you can use Dreamweaver to verify that the page is validin other words, that it follows the rules for its document type. You can validate page markup for any file, or validate XHTML and XML files as XML.
You can also use Dreamweaver to test your pages by verifying support for target browsers, testing for broken links, and generating reports.
Before you validate your pages, however, you need to use the Validator Preferences pane to configure your validation.
To select Validator preferences:
From the Edit menu (Windows) or the Dreamweaver application menu (Mac), select Preferences. The Preferences dialog appears.
Select the Validator category from the list on the left.
The Validator pane appears (Figure 3.41).
Figure 3.41. The Validator pane of the Preferences dialog.
On the Validator pane, select languages to validate your pages against.
Click the Options button to display the Validator Options dialog (Figure 3.42).
Figure 3.42. The Validator Options dialog.
Deselect any Display options that you don't want the Validator report to include (all options are selected by default).
Deselect any options that you don't want the Validator to check for (both options are selected by default).
Both of these options pertain to character entities. If you want Dreamweaver to check for quotation marks and characters (&, <, and >) in your HTML, leave these options selected.
Click OK to save your selections and close the Validator Options dialog.
Click OK on the Validator pane to save your selections and close the Preferences dialog.
Dreamweaver uses the chosen language on the Validator pane only if the page doesn't include a DOCTYPE to specify the language used to create the page.
You can't select multiple versions of the same language on the Validator pane, so choose the earliest version you want to test against.
Certain characters in HTML can be represented by a name or number that's known as a character entity. You use character entities to display characters such as angle brackets (< or >) in HTML pages without having them interpreted as part of the code. For example, " represents quotation marks; < represents a left angle bracket (<); & represents an ampersand (&); and > represents a right angle bracket (>).
To validate markup:
Open an HTML page in Dreamweaver.
From the File menu, choose Check Page > Validate Markup, or press Shift-F6.
The Validator report displays on the Validation panel in the Results panel group at the bottom of the Dreamweaver workspace (Figure 3.43).
Figure 3.43. Choose Check Page > Validate Markup to display the Validator report in the Results panel group.
If you want to view the full text of any error or warning in the Validator report, click the More Info button.
In addition to HTML files, you can also validate the markup for ColdFusion files, SMIL (Synchronized Multimedia Integration Language), WML (Wireless Markup Language), and pages with Java server tags. Just select the appropriate language on the Validator pane of the Preferences dialog.
To validate as XML:
Open an XHTML or XML file in Dreamweaver.
From the File menu, choose Check Page > Validate as XML.
The Validator report displays on the Validation panel in the Results panel group at the bottom of the Dreamweaver workspace.
You can click the More Info button (Figure 3.43) on the left of the Validation panel to get the full text of any error or warning in the Validator report. You can also click the Reference tab in the Results panel group to get more specifics on the use of any tag from Dreamweaver's extensive collection of reference books. If you don't see the Reference panel, press Shift-F1 to open it.
Verifying support for target browsers
In addition to validating your pages, you can also test your code with a browser check in your choice of target browsers.
To verify support for target browsers:
Open your page in Dreamweaver.
On the Document toolbar, click the Check Browser button to the right of the title field (Figure 3.44).
Figure 3.44. Click the Check Browser button on the Document toolbar to open the Check Browser menu.
The Check Browser menu opens (Figure 3.45).
Figure 3.45. The Check Browser menu.
From the Check Browser menu, select Settings. The Target Browsers dialog opens (Figure 3.46).
Figure 3.46. Select target browsers in the Target Browsers dialog.
In the Target Browsers dialog, select the minimum version of each browser you want to use for testing your pages. Click OK to save your settings and close the dialog.
Click the Check Browser button again to display the menu. Select Check Browser Support to test the open page.
The results display on the Target Browser Check panel in the Results panel group (Figure 3.47).
Figure 3.47. View the browser-support results on the Target Browser Check panel.
If you select the Auto-check on Open option from the Check Browser menu, Dreamweaver will automatically check browser support every time the document is opened and display a message when you pause your pointer over the Check Browser button, such as "No Browser Check Errors" or "Found 6 Browser Check Errors." You can view the full report on the Target Browser Check panel.
Troubleshooting your code
You can also troubleshoot your code by checking your site for broken links and by using Dreamweaver reports.
To check for broken links:
Open your page in Dreamweaver.
From the Site menu, choose Check Links Sitewide, or press Ctrl-F8 (Windows) or Command-F8 (Mac).
View the results on the Link Checker panel in the Results panel group (Figure 3.48).
Figure 3.48. View details on broken links on the Link Checker panel when you check links sitewide.
To use Dreamweaver reports:
Open your page in Dreamweaver.
From the Site menu, choose Reports.
The Reports dialog displays (Figure 3.49).
Figure 3.49. Choose Reports from the Sites menu to display the Reports dialog.
In the Report On drop-down menu, select Current Document to test a single page, or Entire Current Local Site (if you have defined a Dreamweaver site).
In the Select Reports section, select the items you want to test in the Workflow and HTML Reports sections.
Click the Run button to run the report.
View the report results on the Site Reports panel in the Results panel group (Figure 3.50).
Figure 3.50. View report results on the Site Reports panel.