Changing the border of the input field to red is nice and all, but it would be better if we could make it a little clearer which field was the problem. In this example, you'll learn how to set the label around the field to be red and bold, making it clear where the problem lies ( Figure 7.7 ). Once again, the HTML and CSS files have not changed (they're still Scripts 7.5 and 7.6). In Script 7.9 , we've added a few lines of JavaScript to the previous Script 7.8 to help point out entry errors. Figure 7.7. When there's a problem, you can make the field's label red and bold, as well as the field itself.
Script 7.9. This script highlights the incorrect field's label when it finds an error.
To identify a problem form field:
|