How to Use jquery to obtain control values in tr and operate tr _ jquery

Source: Internet
Author: User
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 ();
}

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.