function updatecomment() {
     if(document.myform.authorid.value.length==0||
        document.myform.comment.value.length==0) {
        alert("please fill all fields");
        return false;
     }
     if(document.myform.comment.value.length>1024){
        alert("comment can not longer than 1024 characters!");
        return false;
     }
     var curdate = new Date();
     document.myform.comment.value.replace("<","<");
     document.myform.comment.value.replace(">",">");
        document.myform.text.value="<commblock>\n<author>"+document.myform.authorid.value+"</author>\n";
        document.myform.text.value+="<comment>\n"+document.myform.comment.value+"\n</comment>\n";
     document.myform.text.value+="<timestamp>: "
               +curdate.toString()+"</timestamp>\n</commblock>\n";
        return true;
} function submitform() {
        if(updatecomment()!=false)
                document.myform.submit();
} function doemail() {
        document.getElementById("do_email_notify").checked=true;
} window.onload=doemail;
Powered by Habitat