Arrow

Works great - one little issue, can you help me fix? | Peter's Custom Anti-Spam for WordPress | Forum

Back to the custom anti-spam plugin page

Please consider registering
guest

Log In

Lost password?
Advanced Search

— Forum Scope —

  

— Match —

   

— Forum Options —

   

Minimum search word length is 4 characters - maximum search word length is 84 characters

Topic RSS
Works great - one little issue, can you help me fix?
November 4, 2008
11:50 am
Fizzter
Guest

Hi Peter,

I sent you an e-mail too, but then thought it might benefit to post it here if we get a solution and anyone else has the issue.

I’ve been using the custom-anti-spam image on my site for quite a while. It’s just a small personal site, but I got hit with spam bots for a while and thought I would implement something like this. It was ridiculously difficult to find a simple captcha plugin. I found your’s and it’s been working great.

There is one little issue I’m having with it I was hoping you could help me resolve. When I go to a specific post, in IE7, I always get a “Done, but with errors on page” message, with this error:
Line: 172
Char: 5
Error: Object Required
Code: 0
URL: http://www.fizzworld.org/2008/...../its-here/

My website is http://www.fizzworld.org

If you click on a post, you’ll see what I’m talking about. Everything seems to work normal… but that message still bothers me. [Image Can Not Be Found]

Note that if you then proceed to REFRESH the page, no error comes up!

I’d appreciate your help in fixing this. Thanks!

-Andrew

November 4, 2008
11:57 am
Peter
Admin
Forum Posts: 841
Offline

Hi Andrew,

Sadly, I cannot reproduce this error on IE7. I can think of two possible causes.

It might be the JavaScript, which you can turn off. Try using the “manual insert method” as described here:

http://www.theblog.ca/wp-conte.....action.htm

Or, it might be complaining about the “tabindex” value, which is duplicated by another field on your page. Do a search in the plugin file and change the “tabindex” value to 6.

Otherwise, it might be caused by something outside of the plugin.

November 4, 2008
12:39 pm
Fizzter
Guest

I modified the tabindex values but that didn’t solve it.

It appears to be caused by this block of script:

script language=’JavaScript’ type=’text/javascript’
!–
var urlinput = document.getElementById(”url”);
var submitp = urlinput.parentNode;
var substitution2 = document.getElementById(”secureimgdiv”);
submitp.appendChild(substitution2, urlinput);
// –
/script

November 4, 2008
4:21 pm
Peter
Admin
Forum Posts: 841
Offline

Yup, the manual insert method should definitely solve the problem, then :)

November 5, 2008
2:07 am
Peter
Admin
Forum Posts: 841
Offline

Here's some code that you can use to replace those 4 lines of JavaScript:

var commentinput = document.getElementById("comment");
var submitp = commentinput.parentNode;
var substitution2 = document.getElementById("secureimgdiv");
submitp.insertBefore(substitution2, commentinput);

Basically it attaches the anti-spam code above the comment field (which is always visible), instead of below the URL field (which is usually not visible to logged in users). I'll be adding this code to the next release.

December 6, 2008
11:24 pm
Midwestern City Boy
Guest

I discovered that I needed to make the following modification that I thought you might be interested in. Basically it attaches the image stuff before the containing node that has the textarea rather than the textarea itself. This is required if the textarea has a label like the other fields on the most comment templates. It doesn’t hurt anything if the ris no lable; but is required if there is.

var commentinput = document.getElementById(\\”comment\\”);

// Insert before surrounding 'p' or 'div' not 'textarea'.
commentinput = commentinput.parentNode;

var submitp = commentinput.parentNode;
var substitution2 = document.getElementById(\\”secureimgdiv\\”);
submitp.insertBefore(substitution2, commentinput);

December 8, 2008
1:07 pm
Peter
Admin
Forum Posts: 841
Offline

Good one. Thanks for the tip. I'll incorporate something like that for the next release.