function switchIfDone(the_form, this_div, next_div) { var complete = true; for (var loop=0; loop < the_form.elements.length; loop++) { if (the_form.elements[loop].value == "") if (the_form.elements[loop].name == "email_from") { complete = false; } if (the_form.elements[loop].value == "") if (the_form.elements[loop].name == "last_name") { complete = false; } if (the_form.elements[loop].value == "") if (the_form.elements[loop].name == "daytime_ac") { complete = false; } if (the_form.elements[loop].value == "") if (the_form.elements[loop].name == "daytime_prefix") { complete = false; } if (the_form.elements[loop].value == "") if (the_form.elements[loop].name == "daytime_suffix") { complete = false; } } if ((complete == true) && (next_div == "finished")) { submitTheInfo(); } else if (complete == true) { switchDiv(this_div, next_div); } else { alert('Please provide a valid email'); } } function switchDiv(this_div, next_div) { if (getStyleObject(this_div) && getStyleObject(next_div)) { changeObjectVisibility(this_div, "hidden"); changeObjectVisibility(next_div, "visible"); } } function submitTheInfo() { var submission_string=""; for (var form_loop=0; form_loop
"; } } } document.hiddenform.the_text.value = submission_string; // the next two lines are written for debugging - // to put the script into action // comment out the changeObjectVisibility() line // and uncomment the document.hidden.form.submit() line // document.hiddenform.submit(); //changeObjectVisibility("hiddenstuff","visible"); }