JREAM
7/24/2012 - 6:25 PM

Validator Custom

Validator Custom

$.validator.setDefaults({ 

			errorClass: 'error',
			errorElement: 'span',
			errorPlacement: function(error, element) {

				$('.displayError').show();		

				var current = element.parent().find('.displayError');				

				/**

				 * This prevents the error field collapsing

				 */ 

				if ($(error).html() == '') {
					current.html('<span class="error">&nbsp;</span>');
				} else {
					current.html(error);
				}
			},

			success: function(label) {
				label.remove();
			}

		});






<div class="flleft" style="width: 262px;">

		<label>*Email Address</label>

		<input type="text" name="email" value="" id="email" maxlength="75" autocomplete="off"  />		<div class="displayError">&nbsp;</div>

	</div>