www.webdeveloper.com
Results 1 to 4 of 4

Thread: Two forms on each page each have captcha that's interferring with one another

  1. #1
    Join Date
    Sep 2012
    Posts
    5

    Two forms on each page each have captcha that's interferring with one another

    I have two forms on the same page, one for US and one for International customers. Each button prompts the selected form accordingly.

    I'm pretty sure the two forms are conflicting with one another because the International form will not validate the captcha even when it's correct but if you toggle back to original form and us that captcha it validates on the International form.

    Here's a look at the form: http://www.woodzee.com/wholesale-us

    My question...is there an easy way to disable the inactive form so the captcha doesn't interfere?

    Here's the JS:
    Code:
    $(function () {
        $("[name=toggler]").click(function () {
            $("[name=toggler]").removeClass('active');
            $(this).addClass('active');
            $('.toHide').hide();
            $("#blk-" + $(this).val()).fadeIn(1000);
        });
    });
    Here's the HTML (the actual form can be seen in the source code at the link above):
    HTML Code:
    <div id="blk-US" class="toHide" style="display:none;"> {{block type=core/template name=wholesaleUs template=cmg/wholesaleUs.phtml}}</div>
    <div id="blk-International" class="toHide" style="display:none;">{{block type=core/template name=wholesaleIntl template=cmg/wholesaleIntl.phtml}}</div>
    Any help is much appreciated. Thanks in advance!

  2. #2
    Join Date
    May 2006
    Location
    Somewhere behind your screen
    Posts
    1,671
    hiding a form doesn't disable it. try .remove() instead

  3. #3
    Join Date
    Sep 2012
    Posts
    5
    I tried the following as you suggested and no luck:

    Code:
    <script>
    $(function () {
        $("[name=toggler]").click(function () {
            $("[name=toggler]").removeClass('active');
            $(this).addClass('active');
            $('.toHide').remove();
            $("#blk-" + $(this).val()).fadeIn(1000);
        });
    });
    </script>
    I have updated the link if you would like to take a look at the code: http://www.woodzee.com/wholesale-test2

    Thanks for the help!

  4. #4
    Join Date
    May 2006
    Location
    Somewhere behind your screen
    Posts
    1,671
    the page has at least one javascript error

    [27.09.2013 21:43:29] JavaScript - http://www.woodzee.com/wholesale-test2
    Unknown thread
    Uncaught exception: TypeError: 'element.dispatchEvent' is not a function
    Error thrown at line 5734, column 6 in fire(element, eventName, memo, bubble) in http://www.woodzee.com/js/prototype/prototype.js:
    element.dispatchEvent(event);
    called via Function.prototype.apply() from line 438, column 6 in <anonymous function: _methodized>() in http://www.woodzee.com/js/prototype/prototype.js:
    return __method.apply(null, a);
    called from line 5820, column 4 in fireContentLoadedEvent() in http://www.woodzee.com/js/prototype/prototype.js:
    document.fire('dom:loaded');
    this may cause other javascript errors. the page has plenty linked scripts which may conflict to each other and i'm not sure that it will be easy to find where and why

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
HTML5 Development Center



Recent Articles