// ## recall.js
// 	Submiting form

// FUNCTION LIST:
// 	cont2(theform);
// 	cont(theform);
// 	validate(field);
//	onKeyPress();

	function cont2(theform)
 {
    var text
	for(i=0;i<theform.length;i++)
	{
	text=text + theform.elements[i].name +"-"+ i +"<br>"
	}
	document.write(text);
}
 function cont(theform)
{
   var thelength,tval,j,k,i;
   var flag=0;
   thelength=theform.length;
   for(i=0;i<5;i++)
{
			
	if(i==0) 
	{ 
    if((theform.elements[0].value=="")) 
	{ flag=2; alert("Enter your Regn No."); theform.elements[i].focus(); break; 
    } 
    } 
}
 
if (flag==0) 
{ theform.submit(); 
  return 1; 
} 
} 	

function validate(field) {
var valid = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789"
var ok = "yes";
var temp;
for (var i=0; i<field.value.length; i++) {
temp = "" + field.value.substring(i, i+1);
if (valid.indexOf(temp) == "-1") ok = "no";
}
if (ok == "no") {
alert("Invalid entry!");
field.focus();
field.select();
   }
}

function onKeyPress () {
var keycode;
if (window.event) keycode = window.event.keyCode;
else if (e) keycode = e.which;
else return true;
if (keycode == 13) {
alert("Please Click on the Go button to send this");
return false
}
return true 
}
document.onkeypress = onKeyPress;