function validateOnSubmit(thisform)
{
	var elem;
	var errs=0;
	// execute all element validations in reverse order, so focus gets set to the first one in error.    
	var formname = thisform;
	if (formname == 'application_step1')
	{
  		// if required enter third argument as 'true'	otherwise do not use third argument at all 
  		if (!validateTextOnlyNoSpaces(document.forms.application_step1.username,  'inf_username', true)) errs += 1;
  		if (!validateTextOnlyNoSpaces(document.forms.application_step1.password,  'inf_password', true)) errs += 1;
	} // end if application_step1
	
	if (errs>1)  alert('There are fields which need correction before sending');
	if (errs==1) alert('There is a field which needs correction before sending');
	return (errs==0);
};
