Link to home
Start Free TrialLog in
Avatar of Isaac
IsaacFlag for United States of America

asked on

Select data from dynamically created table...

Hi All,

I have a table that will be created dynamically with data.  In the first column will be a textbox with data.  I want to be able to capture when data is changed in any of the columns.  Below is the code but you can also find it in this fiddle.  https://jsfiddle.net/isogunro/sb4ohdkj/1/
<table id='Prioritize' border=1>
  <thead>
    <th>Priority Number</th>
    <th>Title</th>
    <th>Project Name</th>
    <th>Project Number</th>
  </thead>
  <tbody>
    <tr><td><input type='text' name='rowID-1' id='rowID-1' value=1></td><td>IT</td><td>Project Smart</td><td>it-34-xx</td></tr>
    <tr><td><input type='text' name='rowID-2' id='rowID-2' value=1></td><td>IT</td><td>Project Smart</td><td>it-34-xx</td></tr>
    <tr><td><input type='text' name='rowID-3' id='rowID-3' value=1></td><td>IT</td><td>Project Smart</td><td>it-34-xx</td></tr>
    <tr><td><input type='text' name='rowID-4' id='rowID-4' value=1></td><td>IT</td><td>Project Smart</td><td>it-34-xx</td></tr>
    <tr><td><input type='text' name='rowID-5' id='rowID-5' value=1></td><td>IT</td><td>Project Smart</td><td>it-34-xx</td></tr>
    <tr><td><input type='text' name='rowID-6' id='rowID-6' value=1></td><td>IT</td><td>Project Smart</td><td>it-34-xx</td></tr>    
  </tbody>
</table>

Open in new window


$('#rowID-*').change(function () {
    alert($('#rowID-*').val());    
});

Open in new window

https://jsfiddle.net/isogunro/sb4ohdkj/1/
SOLUTION
Avatar of Brian Tao
Brian Tao
Flag of Taiwan, Province of China image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
ASKER CERTIFIED SOLUTION
Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of Isaac

ASKER

Thanks!
You are welcome.