function checkrequired(f) { var checklist = eval(f+'validate'); for (checkthis in checklist) { if(document.getElementById(checklist[checkthis]).value.length==0) { alert('Please complete the required fields.'); return false; alert('Submitting form...'); } } } var pform0validate = [];