The Field Hint Behavior Explained
Update: Comments are closed for this post, but you can go to the wForms forum if you have any question or comment. Thanks !
This post is part of the wForms Documentation.
For additional help, visit the wForms forum.
The purpose of the Field Hint Behavior is to assign a contextual help to an input field and to highlight the help when the field gets the focus.
A field hint can be a short text, an image, or just about anything you deem appropriate.
Implementation
Of course, if you use the form builder you don’t have to worry about the implementation details. If you use the wForms behaviors on your own forms follow these instructions to set the id and classe attributes correctly. That’s all you will need.
- Enable the wForms extension by adding the following code to the <head> element of your page:
<script type="text/javascript" src="wforms.js" ></script> - Assuming that the field has its id attribute set to ’someFieldId’, set the field hint id to ’someFieldId-H‘ (append -H) and add the ‘field-hint-inactive‘ class.
<div id="someFieldId-H" class="field-hint-inactive" >Your Field Hint</div> - Add the following CSS rules to your stylesheet to control the visual effect:
.field-hint {color: #000; /*... or any other css properties ... */}
.field-hint-inactive { color: #999; /*... or any other css properties ... */ }
That’s all folks. Don’t hesitate to give your feedback.
Note: Comments are now closed for this post, but you can go to the wForms forum if you have any question or comment. Thanks !