javascript Validate String Length

function ValidateLength(){
	var strTitle = document.getElementById("Title").value;
	var Length = strTitle.length;
	
	if (Length > 30){
		alert('Greater than 30');
	}else{
		alert('Less than 30');
	}
}
Checks the length of a string and alerts

Updated: Friday 1st October 2010, 02:28pm

There are 0 comments

Leave a comment of your own

Comments are currently closed.