IBM®
Skip to main content
    Country/region select      Terms of use
 
 
   
     Home      Products      Services & solutions      Support & downloads      My account     

developerWorks  >  Lotus  >  Forums & community  >  Best Practice Makes Perfect

Best Practice Makes Perfect

A collaboration with Domino developers about how to do it and how to get it right in Domino

I've been noticing recently several comments were automatically blocked. I believe this is happening because the poster's browsers were set to not execute JavaScript code. This is how the Domino blog application distinguishes between legitimate posts and spambots -- if it can execute JavaScript (and the IP address hasn't been manually blocked), it's presumed to be legitimate.
If this is causing you a problem, sorry -- it does keep the spam down very effectively, and in any case I don't have the option to turn it off. Send me email and I will unblock individual posts as needed.

Andre Guirard | 9 February 2008 04:00:00 AM ET | Caribou Coffee, Plymouth, MN, USA | Comments (1)


 Comments

1) There’s bad JS in this DB.
Erik Brooks | 2/10/2008 11:26:25 AM

I mentioned this before, but it was awhile back.

Steps to reproduce:

1. Open a blog entry to add a comment.

2. Fill in the "Comment" field.

3. Leave subject & name blank.

4. Hit "Submit".

The validation that attempts to run is broken, causing the JS to quit executing and the form to submit anyway. You'll end up with a simple white screen that says "Refused."

Here's the problem:

==========================

function commentValidation(){

var r=true;

var vEmail="No";

var vSubject="Yes";

var vName="Yes";

var vText="Yes";

var msg="Unable to post comment because:"+"\r\r";

var mEmail="An email address is required";

var mSubject="A subject is required";

var mName="Your name is required";

var mText="A comment is required";

document.forms['_DominoForm'].action=document.forms['_DominoForm'].action+"&chk=yy";

//*******************************************

//********* THIS LINE BOMBS *****************

//*******************************************

if(!isNull(f.email)){if(vEmail=="Yes" && f.email.value==""){r=false;msg+=mEmail+"\r"}};

if(!isNull(f.subject)){if(vSubject=="Yes" && f.subject.value==""){r=false;msg+=mSubject+"\r"}};

if(!isNull(f.author)){if(vName=="Yes" && f.author.value==""){r=false;msg+=mName+"\r"}};

if(!isNull(f.textcomment)){if(vText=="Yes" && f.textcomment.value==""){r=false;msg+=mText+"\r"}};

if(r==false){alert(msg)}else{storeCuk();}

return r;

}

==========================

f isn't defined.

2) Number of comments is not correct
Jens Winkelmann | 2/10/2008 7:03:48 PM

There is another problem with the blog application.

The number of comments displayed in brackets is not always correct.

Sometimes you find more comments when you follow the comment link

than the number in brackets says.

3) Thanks for the additional info
Andre Guirard | 2/11/2008 9:03:15 AM

Erik and Jens, thanks for the updates. I've reported Erik's information to the folks who maintain this application for me. They're already working on updating the design to the 8.0 version, which I'm hoping may fix these problems -- we'll see.

4) how about automatically filling in the Subject of a comment?
Charles Robinson | 2/11/2008 1:40:46 PM

I'm subscribed to your comment feed and I have absolutely NO CLUE what most of the comments are in reference to. Let people overwrite the subject if you must, but the default should be something like RE: [topic].

 Add a Comment
Subject:
   
Name:
Comment:  (No HTML - Links will be converted if prefixed http://)
 
Remember Me?     Cancel

Search this blog 

Disclaimer 

    About IBM Privacy Contact