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 there is something entered into the instructions CanSubmit = ForceEntry("WordList", "Please enter words into the word list."); if (!CanSubmit) return; //Check the length of the word list - if this exceeds 200 characters, //POST the information rather tha using GET //Grab the word list text var wordList = document.getElementById("WordList").value; var instructions = document.getElementById("Instructions").value; //If it is longer than 200 characters if (wordList.length + instructions.length > 200) { document.LayoutSpellingPractice.method = "post"; document.LayoutSpellingPractice.VarsPosted.value = "true"; } // check a cell value has been entered CanSubmit = ForceNumber("Cells", "Number of practice lines"); if (!CanSubmit) return; //If fields have been entered correctly, submit the form document.LayoutSpellingPractice.submit(); } //end function