0151 355 4555

Popup Styling

The Ajax Telephone & Email Validation script makes changing the style of any popup validation errors a breeze by providing your own function for displaying errors.

The initializePopupData8Validation method accepts an optional parameter for a function that should be called when the form is submitted with validation errors. This method is called with the first element that is invalid as its parameter. You can implement your own function to use for this to show validation errors as you require, for example:

<div id="errorArea" class="data8error" style="display: none">

<script type="text/javascript">

function showValidationError(element)
	// Get a <div> element to show the errors in.
	var errorArea = document.getElementById('errorArea');

	// Clear out any existing errors.
	while (errorArea.hasChildNodes())

	// Add the error text to the div.

	// Ensure the div is shown.
	errorArea.style.display = 'block';

	// Set the focus to the element.
	if (element.focus)

	if (element.select)