|
A lot will depend on your form layout, but you could append an image tag whose source attribute is a blank gif/jpg and name attribute is identical to the name of the data field. As you loop through the datafields, each empty field can have the corresponding image source (using the images collection) changed to whatever icon you want, such as an exclamation point, etc. This will help identify the offending fields.
You can also replace or insert text, oriented in whcihever way to the offending fields, that states your specific error message, such as "First name is required.", etc.
To keep the elements from re-flowing when you add text/images, make room for them ahead of time. For example, make room for the input field and appended image tag in the table data tag, or add a blank table row (for the error messages) between each data field row. Style settings can then be used to format the presentation accordingly, such as error text in a smaller/larger font size/color, etc.
If any form field validation fails simply cancel the form submit action.
|