How to add multiple record in jquery

Posted by Klbaiju under jQuery on 6/16/2015 | Points: 10 | Views : 1555 | Status : [Member] | Replies : 1
Hi All,

In my application ,i want to add multiple rows from a table to database by a single click using jquery.

following is sample table

<table>
<tr><td>EmpId</td><td>Ename</td><td>Dept</td><td>Salary</td></tr>
<tr><td>1000</td><td>Arun</td>Civil<td>10000</td></tr>
<tr><td>1001</td><td>Kiran</td>Accounts<td>5000</td></tr>
</table>

when a button is clicked i want to save these 2 records into database.

how it is possible using jquery.

Regards

Baiju




Responses

Posted by: Sheonarayan on: 6/17/2015 [Administrator] HonoraryPlatinum | Points: 25

Up
0
Down
use jQuery.each function to iterate through each row and extract the table cell and use jQuery ajax to send data to the server to save into the database.

These two posts can help

http://techfunda.com/Howto/jquery/329/each-iterate-through-each-element
http://techfunda.com/Howto/jquery/jquery-ajax

Thanks

Regards,
Sheo Narayan
http://www.dotnetfunda.com

Klbaiju, if this helps please login to Mark As Answer. | Alert Moderator

Login to post response