function ValidateData() { //Submission variable var CanSubmit = false; //Check to make sure that the worksheet title field is not empty. CanSubmit = ForceEntry("WorksheetTitle", "Please enter a title for the worksheet."); if (!CanSubmit) return; // check numeric entries are numeric CanSubmit = ForceNumber("QuestionCount", "Number of questions"); if (!CanSubmit) return; // check question range if (parseInt(document.getElementById("QuestionCount").value) < 1 || parseInt(document.getElementById("QuestionCount").value) > 99) { alert ("Please enter a value in the 'number of questions' box between 1 and 99."); CanSubmit = false; return; } // check that one of the time types has been entered (eg. must be generating at least one type of time, // such as o'clock, qtr past, half past, qtr to, 5 min intervals or any time. Otherwise - what would go //on the worksheet? if ( (!document.getElementById("OClock").checked) && (!document.getElementById("QtrPast").checked) && (!document.getElementById("HalfPast").checked) && (!document.getElementById("QtrTo").checked) && (!document.getElementById("5Min").checked) && (!document.getElementById("AnyTime").checked) ) { alert("Please tick at least one of the 'times to generate' boxes."); CanSubmit = false; return; } //If fields have been entered correctly, submit the form if (CanSubmit) document.LayoutTime.submit(); } //end function