
function alphanum(myField)
{
	var str=myField.value;
	chkfor=" `~!@#$%^&*()_+-=|\{}[]:;,/<>.?\"'"
	for(i=0;i<chkfor.length;i++){
		for(j=0;j<str.length;j++){
			if(str.charAt(j)==chkfor.charAt(i)){
			    //if(chkfor.charAt(i)==" "){
					//alert("You can not enter space in Field" );
			    //}
			    //else{
					alert("You can not enter character '" + chkfor.charAt(i) + "'");
				//}
				myField.value="";
				myField.focus();
				i=0;
				j=0;
				return false ;
			}
		}
	}
	return true;
}

function isEmpty(myField)
{
		if (myField.value == "")
		{
			alert("Please enter the valid " + myField.name);
			return false;
		}
		return true;
}
	

		
function checkNumeric(Fieldname)	
{
var checkOK = "0123456789/";
		var checkStr = Fieldname.value;
		var allValid = true;
		var allNum = "";
		for (i = 0; i<checkStr.length;  i++)
		{
			ch = checkStr.charAt(i);
				for (j = 0;  j < checkOK.length;  j++)
				{
					if (ch == checkOK.charAt(j))
						break;
					if (j == checkOK.length)
					{
						allValid = false;
						break;
					}
					
				}
					if (!allValid)
					{
				alert("Please enter only digit characters in the \" Fieldname \" field.");
					Fieldname.focus();
					return (false);
					}
			return true;
		}
}
function isEmailId(field)
{
	var id = field.value;
	no1 = id.indexOf("@");
	no2 = id.indexOf(".",no1);
	if (no1 <= 0 || no2 <= (no1+1) )
	{
		alert("Please enter valid email-Id");
		return false;
	}
	return true;		
}

function ValidateData(myForm)
{		
	validity = true;   
 
	var name = document.userdata.name.value;	

	if (document.userdata.name.value == "")
	{   
		document.userdata.name.focus();
		alert("Please enter Name");
		validity = false;	
		return validity;	
	}
	var address=document.userdata.address.value;	

	if (document.userdata.address.value == "")
	{   
		document.userdata.address.focus();
		alert("Please enter Address");
		validity = false;	
		return validity;	
	}
	if (document.userdata.phone.value == "")
	{   
		document.userdata.phone.focus();
		alert("Please enter Pshone");
		validity = false;	
		return validity;	
	}


	if (validity)
	{
		 var where_to= confirm("Are you sure ?");
		 if (where_to== true)
		 {	   
		   return validity;
		 }
		 else
		 {
		 validity=false;
		  return validity;	
		 }
	}

	//document.userdata.submit(myForm);	
}