// This is a javascript file which is local to the client // This is called to check the "post question" form // If fields are not compulsory then change this function // If no fields are compulsory then just "return true" function checkPostQuestionForm(form, questionname) { var error = false; var errorMsg = ""; if (form.question_title.value=="") { error = true; errorMsg += "Please enter the "+ questionname +" title\n"; } if (form.question_text.value=="") { error = true; errorMsg += "Please enter the "+ questionname +" text\n"; } if (error) { alert(errorMsg); } return !error; }