//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אנא כתוב טקסט"; } //If there is aproblem with the form then display an error if (errorMsg != ""){ msg = "תקן את הבעיות הבאות : \n\n"; errorMsg += alert(msg + errorMsg + "\n\n"); return false; } //Reset the submition action document.frmAddMessage.action = '' 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=800,height=600') //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); }