<Table Style = "width: 100%; height: 100% "border =" 1 "> <caption> material/special tool marshal/tool cantainer/transportation/mobile </caption> <tbody> <tr> <TD> Project No </ 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> <span id = "labfinalcustome"> label </span> </TD> <TD> Order No. </TD> <span id = "laborderno"> label </span> </TD> <TD> Project Leaing time: </TD> <span id = "labprojectleaingtime"> label </span> </TD> </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> <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> </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 = "specialtoolrental"> special tool rental </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>
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 ();}