/************* Form Validation ***************/ function validatefield(thisfield,imgname){ if (thisfield.value == "") { imgname.src="/images/stop.gif"; } else { imgname.src="/images/blank.gif"; } } function validatefieldc(fld){ fld.style.color = ((fld.value) == "") ? 'white' : 'black'; fld.style.backgroundColor = ((fld.value) == "") ? 'red' : 'white'; } function validate_email(theControl) { if ( theControl.value == "" || theControl.value.length <= 0 ) { alert("I'm sorry. This email address must be filled in correct to send the form to our server. Please" +" check the prefix and '@' sign."); theControl.focus() return false; } var reEmail = /^.+\@.+\..+$/ var holderValue; var thisValue = theControl.value; // Check for e-mail addresses from ISPs and other sources that have been consistently // entered incorrectly. If detected, correct the situation. if ( (thisValue.substring(thisValue.length - 4, thisValue.length).toLowerCase()) == '@aol' || (thisValue.substring(thisValue.length - 4, thisValue.length).toLowerCase()) == '@msn' || (thisValue.substring(thisValue.length - 6, thisValue.length).toLowerCase()) == '@yahoo' || (thisValue.substring(thisValue.length - 6, thisValue.length).toLowerCase()) == '@lycos' || (thisValue.substring(thisValue.length - 7, thisValue.length).toLowerCase()) == '@excite' || (thisValue.substring(thisValue.length - 10, thisValue.length).toLowerCase()) == '@altavista' || (thisValue.substring(thisValue.length - 11, thisValue.length).toLowerCase()) == '@compuserve' || (thisValue.substring(thisValue.length - 8, thisValue.length).toLowerCase()) == '@prodigy' || (thisValue.substring(thisValue.length - 8, thisValue.length).toLowerCase()) == '@hotmail' || (thisValue.substring(thisValue.length - 9, thisValue.length).toLowerCase()) == '@netscape' ) { holderValue = thisValue.concat('.com'); thisValue = holderValue; theControl.value = thisValue; } if ( (thisValue.substring(thisValue.length - 5, thisValue.length).toLowerCase()) == '@home' ) { holderValue = thisValue.concat('.net'); thisValue = holderValue; theControl.value = thisValue; } // Now check the actual value of the e-mail address for validity. var flagFirstCheck = (theControl.value.length < 6) || (thisValue.indexOf('@') == -1) || (thisValue.indexOf('.') == -1) || (thisValue.indexOf('@',(thisValue.indexOf('@')+1)) != -1) || ((thisValue.indexOf('.')+1) == thisValue.length) || ((thisValue.indexOf('@')+1) == thisValue.length) var flagSecondCheck = reEmail.test(thisValue) if ( flagFirstCheck || !flagSecondCheck) { alert("I'm sorry. This email address seems to be incorrect. Please" +" check the prefix and '@' sign."); theControl.focus() return false; } else { return true; } } function FEmptyControl(control, prompt) { if (control.value=="") { alert("The " + prompt +" field is a required field, and it must be filled in before your form can be sent to our server.") control.focus() return false } return true } function check_search_form(form) { if (!FEmptyControl(form.keywords,'Enter some keywords for search please??')) return false return true } function FSubmitValidation(form) { if (!FEmptyControl(form["event[title]"],'Event Title')) return false if (!FEmptyControl(form["event[category]"],'Event Category')) return false if (!FEmptyControl(form["event[time]"],'Time')) return false if (!FEmptyControl(form["event[description]"],'Description')) return false if (!FEmptyControl(form["event[ticket_price]"],'Price Range')) return false if (!FEmptyControl(form["event[submit_by]"],'Submitted By')) return false if (!FEmptyControl(form["event[submit_name]"],'Your Name')) return false return true } /************* End Form Validation ***************/ /** Green form validation **/ function submitGreenValidation(form) { if (!FEmptyControl(form["name"],'Business/Organizion')) return false if (!FEmptyControl(form["email"],'Email Address')) return false if (!FEmptyControl(form["contact"],'Contact Name')) return false if (!FEmptyControl(form["address"],'Address')) return false if (!FEmptyControl(form["city"],'City')) return false if (!FEmptyControl(form["state"],'State')) return false if (!FEmptyControl(form["zip"],'Zip')) return false if (!FEmptyControl(form["phone"],'Phone')) return false if (!FEmptyControl(form["website"],'Website')) return false return true } /** MySource form validation **/ function submitMysourceValidation(form) { if (!FEmptyControl(form["Name"],'Full Name')) return false if (!FEmptyControl(form["Email"],'Email Address')) return false if (!FEmptyControl(form["MySource"],'WVPE is my source for...')) return false return true } /** Contests form validation **/ function submitContestsValidation(form) { if (!FEmptyControl(form["Name"],'Full Name')) return false if (!FEmptyControl(form["Address"],'Address')) return false if (!FEmptyControl(form["City"],'City')) return false if (!FEmptyControl(form["State"],'State')) return false if (!FEmptyControl(form["Email"],'Email Address')) return false return true } function fAddListItem(strDate) { var dl=document.subForm.days; dl.options[dl.options.length]=new Option(strDate,strDate); } function fRemoveListItem(strDate) { var dl=document.subForm.days; for (var i=0;i