Hi all, I have a contact for that requires validating for a number of things. It validates Required for all parts of the form however fine.

My question is how can I ensure the client fills out the form fully. For instance, here in the UK we use 11 digits for phone numbers, but the form will validate if the clint enters just 1, so how can I ensure the customer actually enters all 11.

Here is the javascript I am using

Code:
function isFilled(str){ return (str != ""); }
	function isEmail(str) {	return (str.indexOf(".") > 2) && (str.indexOf("@") > 0); }
 	function isDigital(str)	{ return(parseFloat(str,10)==(str*1)); }
 	function isCurrency(val) { 	var re = /^(\$?\d+\$?|\$?\d+\.\d+\$?)$/; return (re.test(val)); }
		function ValidForm(form) {
		var field, i;
		var req = new Array(10);
		var email = new Array(1);
		var digits = new Array(1);
		var currs = new Array(0);
		req[0] = "rw_First_Name";
		req[1] = "rw_Last_Name";
		req[2] = "re_Email";
		req[3] = "rd_Mobile_Number";
		req[4] = "r_Hair_Service";
		req[5] = "r_Stylist";
		req[6] = "r_Preferred_Day";
		req[7] = "r_Preferred_Date";
		req[8] = "r_Month";
		req[9] = "r_Preferred_Time";
		email[0] = "re_Email";
		digits[0] = "rd_Mobile_Number";

		for (i=0;i<10;i++)	{
			eval("field = form." + req[i]);
			if (!isFilled(field.value))	{
				alert("Field '" + field.title + "' is required to be filled in before successful submission.");
				field.focus();
				return false;
				break;
			}}
		for (i=0;i<1;i++)	{
			eval("field = form." + email[i]);
			if (!isEmail(field.value)) {
				alert("Field '" + field.title + "' is required to be filled in with valid email addresses before successful submission.");
				field.focus();
				return false;
				break;
			}}
		for (i=0;i<1;i++)	{
			eval("field = form." + digits[i]);
			if (!isDigital(field.value)) {
				alert("Field " + field.title + " is required to be filled in only with digits (0-9) and decimal point before successful submission.");
				field.focus();
				return false;
				break;
			}}
		for (i=0;i<0;i++)	{
			eval("field = form." + currs[i]);
			if (!isCurrency(field.value)) {
				alert("Field " + field.title + " is required to be filled in only with digits (0-9) a decimal point, or a dollar sign before successful submission.");
				field.focus();
				return false;
				break;
			}}
		return true; }