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

  • Home
  • SEARCH
  • 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 7907879
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 3, 20262026-06-03T11:40:30+00:00 2026-06-03T11:40:30+00:00

I have jquery code that runs everytime everytime I click on my button but

  • 0

I have jquery code that runs everytime everytime I click on my button but I only want it do do the stuff inside the click function once.. Beacuse otherwise my jquery code will duplicate values in my tbody td.

Here is my jquery code:

  $(function () {
        $('#next-step').click(function () {
            $('#S').append($('#SubjectTypeName option:selected').text());
            $('#T').append($('#TeamName option:selected').text());
            $('#C').append($('#ConsultantName option:selected').text());
            $('#K').append($('#company option:selected').text());
            $('#KP').append($('#ContactPerson').val());
            $('#P').append($('#date').val());
        });

    });

And here is the jsfiddle: http://jsfiddle.net/82U2W/

Any help is appreciated.

Thanks in advance!

  • 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-03T11:40:32+00:00Added an answer on June 3, 2026 at 11:40 am

    I am not sure if I understood correctly, try .one if you want to execute the handler only once

    $(function() {
        $('#next-step').one('click', function() {
            $('#S').append($('#1 option:selected').text());
            $('#C').append($('#2').val());
            $('#T').append($('#3').val());
        });
    });
    

    DEMO

    Or perhaps you want the value to be copied over instead of appending then try like below,

    $(function() {
        var copiedText = 'Copied Value: ';
        $('#next-step').on('click', function() {
            $('#S').text(copiedText + $('#1 option:selected').text());
            $('#C').text(copiedText +$('#2').val());
            $('#T').text(copiedText +$('#3').val());
        });
    });
    

    DEMO

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

Sidebar

Related Questions

I have some jQuery/JavaScript code that I want to run only when there is
I have a jQuery script that runs a function every second with setinterval. But
I have the following jQuery code: $('.button').click(function(e) { e.preventDefault(); var id = $(this).attr('id'); var
I have some jQuery code that runs fine until I add the jQuery UI
I have a simple jQuery code that runs on a web page that has
I have some jQuery code that intercepts links clicked on a page: $(document).ready(function() {
I have some jQuery code that runs on every $(document).ready() event. I also have
I have the following code jQuery(.opsection input).live('change', function(){ What i want to also do
I have some jQuery code that highlights which radio button is checked by turning
I have a small function that runs on load and window resize.. but the

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.