Need some help with recaptcha plugin

  • Posts: 14
  • Thank you received: 0
  • Hikashop Essential
12 years 3 months ago #33855

Hi Moderator,

I need some help with the recaptcha plugin. I am in the process of setting up Hikashop on my site. I decided to setup the recaptcha first before I setup any products. It works perfectly for the registration page ( www.valorapps.com/component/users/?view=registration ). However, it won't work for the contact form. I setup a contact form, and it does not show: www.valorapps.com/contact-us.html

The plugin is enabled. Display after is set to email. Use in forms is set to Yes. Display option on contact forms is set to "After the message textarea"

Could you help?

Please Log in or Create an account to join the conversation.

  • Posts: 14
  • Thank you received: 0
  • Hikashop Essential
12 years 3 months ago #33868

Hi Moderator!

I found part of the problem. There is a bug in your recaptcha code! The bug applies only to Joomla 1.6 and 1.7. The bug is actually in your recaptcha.xml file. The values that you specify for the field "checkpos" are "contact-text", "contact-email" and "contact-email-copy". If you look earlier in the xml file, the equivalent values for the param "checkpos" are "contact_text", "contact_email" and "contact_email_copy". The difference between the two is the use of a dash "-" in the field version versus the use of an underscore "_" in the params version. The catch is that in the recaptcha.php file, you check for the underscore version. So, that is why I am not getting the recaptcha showing up in my contact forms.

So you need to change the field version values for "checkpos" in the xml file to "contact_text", "contact_email" and "contact_email_copy" instead of "contact-text", "contact-email" and "contact-email-copy".

My problem still exists. So, I still need help.

Hope to hear from you soon.
Michael

Last edit: 12 years 3 months ago by michaelgilkes. Reason: corrections to text

Please Log in or Create an account to join the conversation.

  • Posts: 81515
  • Thank you received: 13069
  • MODERATOR
12 years 3 months ago #33873

Hi,

The Recaptcha plugin was not compatible with the contact form of joomla 1.7
I've uploaded a new version of it which should now work with it. Please download it again an install that new version on your website. It should work better.

Please Log in or Create an account to join the conversation.

  • Posts: 14
  • Thank you received: 0
  • Hikashop Essential
12 years 3 months ago #33900

Hi Nicolas,

Thanks for responding, and for updating the code. However, it still doesn't work. First off, you didn't change the values in the xml file. Second, you are certainly right about the format for Joomla 1.7 being different. However, i think that the regex search string that you use for $id is not matching the html code the joomla 1.7 uses for the contact form. I am not a regex expert by any means. But, if "After the message textarea" is selected, the regex you use is:

id="jform_contact_message".{0,200}(<br */>|</p>|</div>)

but if we look at the html code for the contact form,
<dd><textarea name="jform[contact_message]" id="jform_contact_message" cols="50" rows="10" class="required" aria-required="true" required="required"></textarea></dd>

So, I think the issue is that it is not finding the code, because the regex is not formatter correctly the find it. What do you think?

Oh, please correct the values int he xml file that I mentioned the previous post.

(BTW: the code above is not showing up properly in the post. I tried to edit it a few times to get it to show the html tags, but it's not working. sorry.)

Last edit: 12 years 3 months ago by michaelgilkes. Reason: tried to make tags show in the code. not working.

Please Log in or Create an account to join the conversation.

  • Posts: 81515
  • Thank you received: 13069
  • MODERATOR
12 years 3 months ago #33902

Hi,

I didn't change the XML file because there is nothing to change in it.
It seems that the regex has to be adapted a bit more to handle the </dd> tag.
I've changed it accordingly, please try again.

Please Log in or Create an account to join the conversation.

  • Posts: 14
  • Thank you received: 0
  • Hikashop Essential
12 years 3 months ago #33903

Hi nicolas.

I'll try it again in a minute. However, you're saying that the use of dashes instead of underscores for the "checkpos" values for the fields are deliberate? even though there is no reference to the dashed versions in the code?

Thanks.

Please Log in or Create an account to join the conversation.

  • Posts: 14
  • Thank you received: 0
  • Hikashop Essential
12 years 3 months ago #33906

Hi nicolas,

Thanks for your help.

just to let you know, it works now, but it only worked after I edited the xml file as I described in a previous post.

Secondly, although it shows now, it is using the wrong html tags to display the captcha. Basically, it doesn't put the DT tag around the label, and it puts a span tag around the captcha instead of a dd tag. This affects alignment of the captcha, and the overall look of the form.

I just thought I would mention this so you can make the final changes that will help everyone.

Thanks again.

Please Log in or Create an account to join the conversation.

  • Posts: 81515
  • Thank you received: 13069
  • MODERATOR
12 years 3 months ago #33911

Hi,

Thanks for the information. We updated it again with the corresponding information.

Please Log in or Create an account to join the conversation.

Time to create page: 0.074 seconds
Powered by Kunena Forum