function setActionAndSubmit(newAction) { document.MainForm.action = newAction; document.MainForm.submit(); } function setActionAndSubmitSearch(newAction) { document.MainForm.fForStandardSearch.value = 'yes'; document.MainForm.method = 'GET'; document.MainForm.action = newAction; document.MainForm.submit(); } function isEmailAddr(email) { var result = false; var theStr = new String(email); var index = theStr.indexOf("@"); if (index > 0) { var pindex = theStr.indexOf(".",index); if ((pindex > index+1) && (theStr.length > pindex+1)) result = true; } return result; } function validRequired(formField,fieldLabel) { var result = true; if (formField.value.length == 0) { if (fieldLabel == "selected") { alert('Please enter a value for the ' + fieldLabel +' field.'); } else { alert('Please enter a value for the "' + fieldLabel +'" field.'); } formField.focus(); result = false; } return result; } function allDigits(str) { return inValidCharSet(str,"0123456789"); } function inValidCharSet(str,charset) { var result = true; // Note: doesn't use regular expressions to avoid early Mac browser bugs for (var i=0;i 0) && (month < 13) && allDigits(elems[1]) && (day > 0) && (day < 32) && allDigits(elems[2]) && ((elems[2].length == 2) || (elems[2].length == 4)); } if (!result) { alert('Please enter a date in the format MM/DD/YYYY for the "' + fieldLabel +'" field.'); formField.focus(); } } return result; } /*function validateForm(theForm) { // Customize these calls for your form // Start -------> if (!validRequired(theForm.fullname,"Name")) return false; if (!validEmail(theForm.email,"Email Address",true)) return false; if (!validDate(theForm.available,"Date Available",true)) return false; if (!validNum(theForm.yearsexperience,"Years Experience",true)) return false; // <--------- End return true; }*/