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

129
Views
How to add only one click event on a label?

Hello i'm trying to add an event of click on a button when the user click a label,
its working fine but the user have to click on the label twice i need to make it work from the first click
this is my function :


(function($){



$('.next-on-click .forminator-checkbox-label').on('click', function() {
    $('button.forminator-button.forminator-button-next').trigger('click');
});




})(jQuery);

about 4 years ago · Juan Pablo Isaza
3 answers
Answer question

0

example:

$('.next-on-click .forminator-checkbox-label').on('dblclick', function() {
    $('button.forminator-button.forminator-button-next').trigger('click');
})
about 4 years ago · Juan Pablo Isaza Report

0

<script src="https://cdnjs.cloudflare.com/ajax/libs/jquery/2.0.0/jquery.min.js"></script>
<lable class="next"> Next </lable>
<button class="check">Check</button>

<script>
$('.next').click(function() {
alert("Hi");
    $('button.check').trigger('click');
});
</script>

about 4 years ago · Juan Pablo Isaza Report

0

So why would you need JavaScript to handle the click? Adding an for attribute on a label will click the button.

$("#btn").on("click", function () {
  console.log("clicked");
});
<script src="https://cdnjs.cloudflare.com/ajax/libs/jquery/3.3.1/jquery.min.js"></script>
<label for="btn">Label</label>
<button id="btn">Button</button>

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!