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 8943171
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 15, 20262026-06-15T11:42:33+00:00 2026-06-15T11:42:33+00:00

I have a table of generated results, each that comes with an edit button.

  • 0

I have a table of generated results, each that comes with an edit button.

<table>
    <tr>
      <td>Some Result 1</td><td><a href='#edit_tmp_form' data-toggle='modal' role='button' class='response-edit btn btn-warning'>Edit</a></td>
    </tr>
    <tr>
      <td>Some Result 2</td><td><a href='#edit_tmp_form' data-toggle='modal' role='button' class='response-edit btn btn-warning'>Edit</a></td>
    </tr>
</table>

And I have a temporary form.

<div id="edit_tmp_form" class="modal hide fade" tabindex="-1" role="dialog" aria-labelledby="form_label" aria-hidden="true">
  <div class="modal-header">
    <button type="button" class="close" data-dismiss="modal" aria-hidden="true">×</button>
    <h4 id="form_label">Edit</h4>
    <form class="form-inline" method="post" action="/somewhere">
        <input type="text" id="add_name" class="input" placeholder="something" name="name">
        <button id='add_c' disabled="disabled" type="submit" class="btn">增加</button>
    </form>
  </div>
</div>

Thus far, everything works fine.

However, I am trying to edit the input field based on the object I want to edit.

For example:
If I were to click on the edit button that resides beside “Some Result 1”, I am expecting the input field to be pre-filled with “Some Result 1”.

I tried using jQuery, which then led to the problem.

If I were to do this:

$('.response-edit').click(function(){
   console.log('abc');
});

The code does not run as expected, when the button is clicked. I made an assumption that bootstrap data-toggle runs before the onclick event listener, hence not reading my code.

Is there any way around this? Or is my assumption wrong? If my assumption is wrong, please lead me on the correct path.

Thank you.

  • 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-15T11:42:35+00:00Added an answer on June 15, 2026 at 11:42 am

    According to the bootstrap code ( https://github.com/twitter/bootstrap/blob/master/js/bootstrap-modal.js ), bootstrap use the click event and prevent the default browser behavior. So here, bootstrap just prevent the browser to navigate when you click an anchor.

    But bootstrap don’t prevent the click event from bubbling so you should be able to catch it and do what you want. I just tried a little example with a log message on a click on an anchor with a data-toggle=modal and a simple modal. And it works.

    Maybe you try to bind the click event when your elements are just not here ?

    Try this :

    $('body').on('click', '.response-edit', function(){
       console.log('abc');
    });
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a List of TableLayout's that are each generated from data in my
I have a dynamically generated table and for each row in the table there
I have an Entity Framework generated table with values in a td that I
Fiddle: http://jsfiddle.net/MhWm5/16/ I have some dynamically generated table rows/values with dynamic IDs <td class=control-group>
I have a DB table in which each row has a randomly generated primary
I have an html table containing values that are being generated from javascript. How
I have a table which is dynamically generated upon clicking a search button as
I have a table generated by PHP/mysql, I want a user to click the
I'm working on a web page where I have a dynamically generated table where
I generated a table demo of something similar to what I have on my

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.