//Function to check form is filled in correctly before submitting function CheckForm () { var errorMsg = ''; //Check for message if (document.frmAddMessage.message.value==''){ errorMsg += "\n\t内容: \t\t- 请输入内容再发送"; } //If there is aproblem with the form then display an error if (errorMsg != ""){ msg = "_______________________________________________________________\n\n"; msg += "The form has not been submitted because there are problem(s) with the form.\n"; msg += "Please correct the problem(s) and re-submit the form.\n"; msg += "_______________________________________________________________\n\n"; msg += "The following field(s) need to be corrected: -\n"; errorMsg += alert(msg + errorMsg + "\n\n"); return false; } //Reset the submition action document.frmAddMessage.action = 'article_display.asp' document.frmAddMessage.target = '_self'; return true; } //Function to open preview window function OpenPreviewWindow(targetPage, formName){ now = new Date //Open the window first openWin('','preview','toolbar=0,location=0,status=0,menubar=0,scrollbars=1,resizable=1,width=680,height=400') //Now submit form to the new window formName.action = targetPage + "?ID=" + now.getTime(); formName.target = "preview"; formName.submit(); } //Function to open pop up window function openWin(theURL,winName,features) { window.open(theURL,winName,features); }