var submitter = "true"; EW_dateSep = "/"; function EW_checkMyForm(EW_this) { if (EW_this.position && !EW_hasValue(EW_this.position, "TEXT")) { if (!EW_onError(EW_this, EW_this.position, "TEXT", "Please enter your title at your church")) return false; submitter = "false"; } if (EW_this.churchName && !EW_hasValue(EW_this.churchName, "TEXT")) { if (!EW_onError(EW_this, EW_this.churchName, "TEXT", "Please enter your church name")) return false; submitter = "false"; } if (EW_this.churchAdd && !EW_hasValue(EW_this.churchAdd, "TEXT")) { if (!EW_onError(EW_this, EW_this.churchAdd, "TEXT", "Please enter your church address")) return false; submitter = "false"; } if (EW_this.churchCity && !EW_hasValue(EW_this.churchCity, "TEXT")) { if (!EW_onError(EW_this, EW_this.churchCity, "TEXT", "Please enter your church city")) return false; submitter = "false"; } if (EW_this.churchState && !EW_hasValue(EW_this.churchState, "SELECT")) { if (!EW_onError(EW_this, EW_this.churchState, "SELECT", "Please select your state")) return false; submitter = "false"; } if (EW_this.churchZip && !EW_hasValue(EW_this.churchZip, "TEXT")) { if (!EW_onError(EW_this, EW_this.churchZip, "TEXT", "Please enter your church zip")) return false; submitter = "false"; } if (EW_this.churchZip && !EW_checkzip(EW_this.churchZip.value)) { if (!EW_onError(EW_this, EW_this.churchZip, "TEXT", "Incorrect ZIP code")) return false; submitter = "false"; } if (EW_this.churchCountry && !EW_hasValue(EW_this.churchCountry, "TEXT")) { if (!EW_onError(EW_this, EW_this.churchCountry, "TEXT", "Please enter your church country")) return false; submitter = "false"; } if (EW_this.phone1 && !EW_hasValue(EW_this.phone1, "TEXT")) { if (!EW_onError(EW_this, EW_this.phone1, "TEXT", "Please enter your church Area Code")) return false; submitter = "false"; } if (EW_this.phone2 && !EW_hasValue(EW_this.phone2, "TEXT")) { if (!EW_onError(EW_this, EW_this.phone2, "TEXT", "Please enter your church Phone Prefix")) return false; submitter = "false"; } if (EW_this.phone3 && !EW_hasValue(EW_this.phone3, "TEXT")) { if (!EW_onError(EW_this, EW_this.phone3, "TEXT", "Please enter your church Phone Last Four Numbers")) return false; submitter = "false"; } if (EW_this.groupName && !EW_hasValue(EW_this.groupName, "TEXT")) { if (!EW_onError(EW_this, EW_this.groupName, "TEXT", "Please enter your youth group name")) return false; submitter = "false"; } if (EW_this.approx && !EW_hasValue(EW_this.approx, "TEXT")) { if (!EW_onError(EW_this, EW_this.approx, "TEXT", "Please enter the approximate number of students you intend to bring!")) return false; submitter = "false"; } var students = document.form1.numstudents.value; var leaders = document.form1.numleaders.value; var minimum = 5; var outp = 0; inp = students / 5; outp = Math.ceil (inp); if(leaders < outp) { alert('You must have a minimum of ' + outp + ' leaders. Please update the number of leader spots (as there is a 5 to 1 student to leader ratio).'); document.form1.numleaders.value = outp; NumLeaders(this); return false; } if (EW_this.regurl && !EW_hasValue(EW_this.regurl, "TEXT")) { if (!EW_onError(EW_this, EW_this.regurl, "TEXT", "Please enter a name that references your group for your registration link!")) return false; submitter = "false"; } if (EW_this.elements["agree"] && !EW_hasValue(EW_this.elements["agree"], "CHECKBOX")) { if (!EW_onError(EW_this, EW_this.elements["agree"], "CHECKBOX", "You must check AGREE to the group leader acknowledgements!")) return false; submitter = "false"; } $('#loading').show(); // show animation $('#submit').fadeTo('slow', 0.3); $(':submit',this).attr('disabled','disabled'); return true; // allow regular form submission }