The Field Help (X.)H.T.M.L. Structural Markup
What are the benefits of this method?
- Help is contained within the same web page as the form. It is not external to it as in the Form Help Method.
- No pop-up or new window is needed to show the help. This is an important factor regarding web accessibility and standards.
- If DOM/JavaScript is turned off in the user agent/browser, the Context-Sensitive help will automatically show below each field name.
- The anchor elements attached to the help icon image elements that open and close the help will be removed, since there is no action needed to trigger its display.
- Important Note: This method also allows users dependant on keyboards to tab through each field and easily activate the help. This is an important useability and accessibility component of the technique.
Unobtrusive DOM/JavaScript Cross-Referencing / Related Container Method (as designed by Gez Lemon of The Paciello Group)
The DOM/javaScript cross-referencing technique produces a relationship between two markup elements.
- In this case, it associates the image element (holds the help icon image open/close trigger) with the div help container element (holds the help content).
- A relationship is created between each field image id attribute and value and its corresponding div help container id attribute and value.
- Each of these id attributes and their values work together with the external fieldhelp.js file to produce the behavior of opening and closing the help.
- Definitions to the highlighted code in the following code block:
- <img id="subjecthelp" The help icon image id attribute with its value of subjecthelp.
- <div id="containersubjecthelp"> The div help container id attribute with its value of containersubjecthelp.
- Note: Two empty code lines are placed between each field section in the code block for easier reading.
-
<form action="#" method="post" id="enquiryform">
-
<fieldset>
-
<legend>Enquiry Form</legend>
-
<h3 class="form" title="help instructions">
-
Activate/Click a Help icon to open or close help.
-
</h3>
-
-
-
<div>
-
<label for="subject" title="Subject dropdown list">
-
Subject <span class="req">(required)</span>
-
<img id="subjecthelp" alt="help for subject field" class="help" -
width="16" height="16" src="images/help_small.gif" />
-
</label>
-
</div>
-
<div id="containersubjecthelp"> -
<p class="cshelp">
-
Please select a subject in the dropdown list.
-
</p>
-
</div>
-
<div>
-
<select name="subject" id="subject">
-
<option value="">Select a Subject</option>
-
<option value="Option 1">Help Authoring Tools</option>
-
<option value="Option 2">Microsoft HTML Help</option>
-
<option value="Option 3">Web-based Help</option>
-
<option value="Option 4">Context-Sensitive Help</option>
-
</select>
-
</div>
-
-
-
<div>
-
<label for="name" title="Name field">
-
Name <span class="req">(required)</span>
-
<img id="namehelp" alt="help for name field" class="help" -
width="16" height="16" src="images/help_small.gif" />
-
</label>
-
</div>
-
<div id="containernamehelp"> -
<p class="cshelp">
-
Please enter your full name in the textbox.
-
</p>
-
</div>
-
<div>
-
<input type="text" name="name" id="name" />
-
</div>
-
-
-
<div>
-
<label for="email" title="Email field">
-
Email <span class="req">(required)</span>
-
<img id="emailhelp" alt="help for email field" class="help" -
width="16" height="16" src="images/help_small.gif" />
-
</label>
-
</div>
-
<div id="containeremailhelp"> -
<p class="cshelp">
-
Please enter your email address in the textbox.
-
</p>
-
</div>
-
<div>
-
<input type="text" name="email" id="email" />
-
</div>
-
-
-
<div>
-
<label for="message" title="Message field.">
-
Message <span class="req">(required)</span>
-
<img id="messagehelp" alt="help for message field" class="help" -
width="16" height="16" src="images/help_small.gif" /></label>
-
</div>
-
<div id="containermessagehelp"> -
<p class="cshelp">
-
Please enter your message in the textbox.
-
</p>
-
</div>
-
<div>
-
<textarea name="message" id="message" rows="6" cols="30"></textarea>
-
</div>
-
-
-
<div>
-
<label for="update" title="Receive updates checkbox">
-
Send Me Updates <span class="req">(optional)</span>
-
<img id="updateshelp" alt="help for updates checkbox" class="help" -
width="16" height="16" src="images/help_small.gif" />
-
</label>
-
</div>
-
<div id="containerupdateshelp"> -
<p class="cshelp">
-
Check the box if you want to receive updates.
-
</p>
-
</div>
-
<div>
-
<input class="checkbox" type="checkbox" name="update" id="update" value="n" />
-
</div>
-
-
-
<label for="submit" title="Click to submit your data.">
-
<input class="submit" type="submit" id="submit" value="Submit Enquiry" />
-
</label>
-
</fieldset>
-
</form>