Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8785825
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 13, 20262026-06-13T21:27:31+00:00 2026-06-13T21:27:31+00:00

I’ve been strugling with a bug that impact jQtransform : When you click on

  • 0

I’ve been strugling with a bug that impact jQtransform :

When you click on a label associated to a checkbox, it “visually” checks the box but when submitting the form, it’s not sent. (so it only checks the jqTransform layer and not the real checkbox)

  • Given the same scenario with a radio -> it works
  • Clicking direclty on the checkbox -> it works

    $.fn.jqTransCheckBox = function(){
    return this.each(function(){
        if($(this).hasClass('jqTransformHidden')) {return;}
    
        var $input = $(this);
        var inputSelf = this;
    
        //set the click on the label
        oLabel = jqTransformGetLabel($input);
        oLabel && oLabel.click(function(){aLink.trigger('click');}); // -> Bug here ?
    
        var aLink = $('<a href="#" class="jqTransformCheckbox"></a>');
        //wrap and add the link
        $input.addClass('jqTransformHidden').wrap('<span class="jqTransformCheckboxWrapper"></span>').parent().prepend(aLink);
        //on change, change the class of the link
                    $input.change(function(){
                      inputSelf.checked && aLink.addClass('jqTransformChecked') || aLink.removeClass('jqTransformChecked');
                      return true;
                    });
        // Click Handler, trigger the click and change event on the input
        aLink.click(function(){
            //do nothing if the original input is disabled
            if($input.attr('disabled')){return false;}
            //trigger the envents on the input object
                            $(this).toggleClass('jqTransformChecked');
            $input.trigger('click').trigger("change");
            return false;
        });
    
        // set the default state
        this.checked && aLink.addClass('jqTransformChecked');
    });
    

    };

Thanks

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-13T21:27:32+00:00Added an answer on June 13, 2026 at 9:27 pm

    It seems aLink.trigger('click') call isn’t working for some reason.
    I fixed this by replacing this line:

    oLabel && oLabel.click(function(){aLink.trigger('click');});
    

    with the following:

    oLabel && oLabel.click(function(){
        var forAttr = null;
        if(forAttr = $(this).attr('for')) {
            var element = $(this).siblings('#' + forAttr);
            if(element.length) {
                element.trigger('click');
            }
        }
        else {
            aLink.trigger('click');
        }
    });
    

    What this does is check in the label’s siblings for the element in its “for” attribute and if the element exists it uses that, instead of aLink.
    I’m using siblings because it’s faster than searching the entire document. Feel free to change that if needed.

    Hope this helps.

    EDIT:
    Okay, i may have rushed into it with this answer. My solution is wrong on many levels.

    What i believe is actually happening is that clicking the label causes a double click. So, when clicking the label, the default click is triggered which checks the element and another click is triggered immediately after that which unchecks the checkbox.

    My previous solution wasn’t actually doing anything, just preventing a second call since none of the conditions actually came through (the ‘#’ + forAttr element isn’t a sibling).

    I found that just commenting out the line with the error fixes this issue.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a jquery bug and I've been looking for hours now, I can't
I have a French site that I want to parse, but am running into
I'm parsing an RSS feed that has an &#8217; in it. SimpleXML turns this
link Im having trouble converting the html entites into html characters, (&# 8217;) i
That's pretty much it. I'm using Nokogiri to scrape a web page what has
I want to count how many characters a certain string has in PHP, but
I have a string like this: La Torre Eiffel paragonata all&#8217;Everest What PHP function
I've got a string that has curly quotes in it. I'd like to replace
I have a small JavaScript validation script that validates inputs based on Regex. I
I am doing a simple coin flipping experiment for class that involves flipping a

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.