// JavaScript Document function selectAll(theField) { var tempval=eval("document."+theField) tempval.focus() tempval.select() } // Clears field if the default value is there. function clear_field(field) { if (field.value==field.defaultValue) { field.value='' } } // Checks field to see if any information was entered. If not, the default value is reentered. function check_field(field) { if (field.value=='' || field.value==' ') { field.value=field.defaultValue } } // Validates the form. If a field fails the validation, The form is not submitted. function validate_form() { // Validates the name field. if (document.jsform.name.value==document.jsform.name.defaultValue || document.jsform.name.value.indexOf(' ',0)==0) { alert('\nNo name entered.') document.jsform.name.select() document.jsform.name.focus() return false } // Validates the email field. if (document.jsform.email.value==document.jsform.email.defaultValue) { alert('\nNo email address entered.') document.jsform.email.select() document.jsform.email.focus() return false } if (document.jsform.email.value.indexOf('@',0)==-1 || document.jsform.email.value.indexOf('.',0)==-1) { alert('\nInvalid email address.') document.jsform.email.select() document.jsform.email.focus() return false } // Prompts user for confirmation else { if(confirm('\nClick the OK button to send this form via email.')) { return true } else { return false } } }