Copy codeThe Code is as follows:
<Table style = "width: 100%; height: 100%" border = "1">
<Caption>
Material/Special Tool marshal/Tool Cantainer/Transportation/Mobile </caption>
<Tbody> <tr>
<Td>
Project No
</Td>
<Td>
<Input type = "hidden" name = "hidProjectInnerID" id = "hidProjectInnerID">
<Input name = "txtProjectNo" type = "text" id = "txtProjectNo" class = "Error"> <a href = "javascript: void (0) "onclick =" SelectProject (); "> select </a>
</Td>
<Td>
Final Custome:
</Td>
<Td>
<Span id = "labFinalCustome"> Label </span>
</Td>
<Td>
Order No.
</Td>
<Td>
<Span id = "labOrderNo"> Label </span>
</Td>
<Td>
Project Leaing Time:
</Td>
<Td>
<Span id = "labProjectLeaingTime"> Label </span>
</Td>
</Tr>
<Tr>
<Td colspan = "8">
Exchange Rate: 8.3000
</Td>
</Tr>
<Tr align = "center">
<Td>
Item
</Td>
<Td colspan = "2">
Description
</Td>
<Td>
QTY
</Td>
<Td>
Unit
</Td>
<Td>
Total
</Td>
<Td>
Remark
</Td>
<Td>
<A id = "NewItem" href = "javascript: void (0)"> NewItem </a>
</Td>
</Tr>
</Tbody> <tbody id = "tbItem">
<Tr align = "center">
<Td>
</Td>
<Td colspan = "2">
</Td>
<Td>
</Td>
<Td>
</Td>
<Td>
</Td>
<Td>
</Td>
<Td>
</Td>
</Tr>
<Tr id = "tbItem1" align = "center"> <td> <select id = "selItem" name = "Item"> <option value = "Material"> Material </ option> <option value = "Mobile"> Mobile </option> <option value = "Others"> Others </option> <option value = "specialtoolmarshal"> Special Tool Marshal </option> <option value = "ToolContainer"> Tool Container </option> <option value = "Transportation"> Transportation </option> <option value = "WorkingHours"> WorkingHours </option> </select> </td> <td colspan = "2"> <input id = "txtDescription" style = "width: 90% "type =" text "name =" Item "> </td> <input id =" txtQTY "type =" text "name =" Item "> </ td> <input id = "txtUnit" type = "text" name = "Item"> </td> <input id = "txtTotal" type =" text "name =" Item "> </td> <input id =" txtRemark "type =" text "name =" Item "> </td> <td> <a href = "javascript :; saveItem ('tbitem1') "> Save </a> | <a href =" javascript:; DelItem ('tbitem1 ') "> Delete </a> <input id =" txtInnerID "type =" hidden "name =" Item "> </td> </tr> </tbody>
</Table>
Copy codeThe 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 ();
}