0151 355 4555

Inline Styling

The Ajax Telephone & Email Validation script makes changing the style of any validation errors a breeze by configuring the data8error CSS class, for example:

<style type="text/css">
	margin-left: 1em;
	border: 1px solid #ff0000;
	background-color: #ffeeee;
	padding: 2px;

Technical Details

When an inline error message is displayed, the textbox that caused the error is placed inside a div element, and a new span element with a class of data8error is added to the same div and the error message is placed within this div. You may therefore need to adjust your CSS or HTML with this in mind to get the exact layout you require.

As an example, the following HTML DOM:

        ─ div
          │ input
          └ input

becomes the following if a validation error occurs in the first input element.

        ─ div
          ├ div
          │ ├ input
          │ └ span
          └ input