Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

154
Views
jQuery progress prevention code stop working

I have this snippet to prevent auto-progress in form on the step where user must select multiple questions. The problem now is that it prevent auto progress, but when user select one of the checkboxes it's impossible to deselect it. It's for a plugin on Wordpress

(function ($) {
jQuery('#tab .question').on('click', function (e) {
    e.preventDefault();
    $target = jQuery(e.target);
    var isChecked = $target.prev().attr('checked');
    if (isChecked) {
        $target.prev().prop('checked', false);
    } else {
        $target.prev().prop('checked', true);
    }
});
})(jQuery);
about 4 years ago · Juan Pablo Isaza
1 answers
Answer question

0

//Your code not clear. Just try this below code
(function ($) {
jQuery('#tab .question').on('click', function (e) {
    $target = jQuery(e.target);
    var isChecked = $target.prev().attr('checked');
    if (isChecked) {
        $target.prev().prop('checked', false);
    } else {
        $target.prev().prop('checked', true);
    }
    e.preventDefault();
});
})(jQuery);
about 4 years ago · Juan Pablo Isaza Report
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!