This tutorial will introduce in detail how jquery gets control values in tr and operates tr. The code is very simple. If you are interested, refer to the following. I hope this will help you.
The Code is as follows:
Material/Special Tool marshal/Tool Cantainer/Transportation/Mobile
Project No
|
Select
|
Final Custome:
|
Label
|
Order No.
|
Label
|
Project Leaing Time:
|
Label
|
Exchange Rate: 8.3000
|
Item
|
Description
|
QTY
|
Unit
|
Total
|
Remark
|
NewItem
|
|
|
|
|
|
|
|
| MaterialMobileOthersSpecial Tool marshalTool ContainerTransportationWorkingHours |
|
|
|
|
|
Save | Delete |
The Code is as follows:
Function SaveItem (index ){
Var tr = $ ("tr [id =" + index + "]");
Var innerid = tr. find ('input [ID $ = txtInnerID] '). val ();
Var item = tr. find ("select [id * = selItem]"). val ();
Var des = tr. find ('input [ID $ = txtDescription] '). val ();
Var qty = tr. find ('input [ID $ = txtQTY] '). val ();
Var unit = tr. find ('input [ID $ = txtUnit] '). val ();
Var total = tr. find ('input [ID $ = txtTotal] '). val ();
Var remark = tr. find ('input [ID $ = txtRemark] '). val ();
// Alert (innerid + "/" + item + des + qty + unit + total + remark );
// Verify the Project ID
Var proinnerid = $ ("# hidProjectInnerID"). val ();
If (proinnerid = ""){
$ ("# TxtProjectNo"). removeClass ("Field ");
$ ("# TxtProjectNo"). addClass ("Error ");
Return false;
}
/*
JQuery. ajax ({
Type: 'get ',
Url: '../Handler/ProjectReport. ashx ',
Data: {"key": "save", "proinnerid": $ ("# hidProjectInnerID "). val (), "innerid": innerid, "type": type, "content": content, "startdate": startdate, "enddate": enddate, "remark ": remark },
Cache: false,
Success: function (result ){
Var jsonobj = eval (result );
If (jsonobj [0]. result = "true ")
Alert ("Sueecss ");
Else
Alert ("Error ");
}
});
*/
}
Function DelItem (index ){
Var tr = $ ("tr [id =" + index + "]");
// Var innerid = tr. find ('input [ID $ = txtInnerID] '). val ();
$ ("Tr [id =" + index + "]"). remove ();
}