Validating Form Input

Here is a nice little bit of code you can add directly to the landing page editor to validate that the correct phone number format is entered. The code can easily be modified to validate other fields and formats as well. 

Example validating phone number form input

<script src="http://ajax.googleapis.com/ajax/libs/jquery/1.5/jquery.min.js"></script>
<script src="http://jquery-joshbush.googlecode.com/files/jquery.maskedinput-1.2.2.js">
</script>
<script type="text/javascript">
$(document).ready(function() { 	$('input[name$="Phone"]').mask("(999) 999-9999");
	$('input[name$="Phone"]').blur(function() {
		if(!$('input[name$="Phone"]').val()) {
		alert('Please enter a valid phone number');
		return false;
		}
});
}); 
</script>