Interspire Product Knowledge Base

Would you like to...

Print this page Print this page

Email this page Email this page

Post a comment Post a comment

Subscribe me

Remove from favorites Remove from favorites

Remove Highlighting Remove Highlighting

Edit this Article

Export to PDF

User Opinions (2 votes)

50% thumbs up 50% thumbs down

How would you rate this answer?



Thank you for rating this answer.

How can I use multiple forms with CAPTCHA codes on the same page?

If you use multiple forms with CAPTCHA codes on the same page, you may experience a problem where a correctly entered CAPTCHA code is always rejected.

In order to use multiple CAPTCHA forms on one page, you need to modify the code of all of your forms to use the same CAPTCHA. Otherwise only the most recently loaded CAPTCHA code will be valid for all forms.

Here are the steps to modify the code to get this to work:
  1. On your page where the forms are located, find all the JavaScript blocks that start with:
    <script type="text/javascript">
    // <![CDATA[
        var SIDString = '';
    and eliminate all but one of them (each block starts with <script type="text/javascript"> and ends with </script>). Put this remaining block up towards the top of your page before any other form code is used.

  2. Locate all the JavaScript blocks that start with:
    <script type="text/javascript">
    // <![CDATA[
    var url = "...";
    document.write("...");
    and cut the
    var url = "...";
    line out from all of the blocks and paste it once at the end of the last remaining block that you left in Step 1. It needs to be added just before these lines:
    // ]]>
    </script>
You should now have one block near the top of your page that looks like:
<script type="text/javascript">
// <![CDATA[
    var SIDString = '';
[...]
var url = "...";
// ]]>
</script>
and the code to generate the CAPTCHA images should each look like:
<script type="text/javascript">
// <![CDATA[
document.write("<img src='" + url + "' alt='img'/>");
// ]]>
</script><br/><input type="text" name="captcha" value="" />
This will ensure that each CAPTCHA code on the page is the same, preventing them from clashing.

Related Articles

No related articles were found.

Attachments

No attachments were found.

Powered by Interspire Knowledge Manager - World's #1 Best Selling FAQ and Knowledge Base Software