User Guide

Validating code 123
6 In the Tag Options box, select Required in document and click Apply Options.
7 Expand the img node, select the Attributes folder and click Add.
8 In the New Attribute dialog box, enter alt and click OK.
9 Select the Required folder, and click Add.
10 In the Add Required Attribute dialog box, enter alt and click OK.
The Versions tab is for extending the tag sets against which you can validate, and
the Values tab is for validating regular expressions. These are unnecessary for a
standard HTML 4.0 document, so this configuration is complete.
11 Click OK.
12 Back in the Settings dialog box, click Apply.
Note
For an example of validating against the XHTML 1.0 specification, see “Configuring
the validator for XHTML” on page 105.
Running the validator
You can run the validator for the current document or for a selected tag. However,
validating a tag only checks the contents of the specific tag; for example, it does not
check if a tag has an end tag or if the tag is in the wrong place in the document.
Note
If you validate both CFML and HTML in a single document, the validator cannot
assess the pound sign (#). This is because, in CFML, the single pound sign is an error
and the double pound sign is correct; while in HTML, the double pound sign is an
error and the single pound sign is correct.
To validate the current document:
1 Select Tools > Validate Current Document.
The Validation Results pane displays a “No errors or warnings” message or lists
the syntax errors that it found.
2 Double-click an error message to highlight it in the document.
You can then correct the code as needed.
To validate the contents of a single tag, do one of the following:
Position the cursor inside the tag and select Tools > Validate Current Tag.
Position the cursor inside the tag and press F6.
Validate each tag automatically after you enter it. To do this, open the Options >
Settings > Validation pane, select Tag validation - validates the current tag when
the “>” key is typed, and click Apply.