"JavaScript" table, click on a TD to get the other TD value of the same line TR

Source: Internet
Author: User

A TD Input (save button) binding method, click the button to save all the data on the line

function Locationedit (num) {var ordernumber= $ ("#" +num). Parent (). Parent (). Find ("TD"). EQ (1). text (); var ItemNumber= $ ("#" +num). Parent (). Parent (). Find ("TD"). EQ (4). text (); var LocationID= $ ("#" +num). Parent (). Parent (). Find ("TD"). EQ (3). text (); var Whid= $ ("#" +num). Parent (). Parent (). Find ("TD"). EQ (9). text (); $.ajax ({type:"GET", URL:"Changelocationid?" + "ordernumber=" +ordernumber+ "&itemnumber=" +itemnumber+ "&locationid=" +locationid+ "&whid=" +Whid, data: {}, Success:function (data) {if(data.code== "00") {simplepop.confirm ("Shelf update is successful!" ", {type:"Error", Confirm:function () {var searchparams= Getsearchparams ("Querywindow"); var URL= "Getorderpickpage"; Gobacklist (Url,searchparams,"POST");                         }                              }); }Else{simplepop.confirm ("Shelf update failed!" ")                         }                                                  }})        }

Another example

$ (' #add_po '). Click (function () {//Product Code Verification                if($ ("#itemnumber"). val () = = "") {Simplepop.alert ("The product code cannot be empty!" "); return false;                 }; var tableId= document.getElementById ("Insertrkdetailbody"); Insertrkdetailbody is the ID of tbody var str= "";  for(Var i=1;i<tableid.rows.length;i++) {//Get each row of data inside the table's tbody str= Tableid.rows[i].cells[3].innerhtml;//The value of the fourth TD for each rowif($ ("#itemnumber"). val () = =str) {Simplepop.alert ("The product code already exists!" "); return false; }        }         //Digital Verificationvar val= $ ("#qty"). Val (); var Regu=/^[1-9]\d*$/; if(val! = "") {            if(!Regu.test (val)) {Simplepop.alert (' Please enter a positive integer '); return false; }           }          Else{Simplepop.alert (' Number cannot be empty '); return false; } senddatatotbody (' AddRow ', ' po_dtl_form ', ' insertrkdetail '); ClearData (' Po_dtl_form '); $("#cancel"). Trigger (' click '); });

"JavaScript" table, click on a TD to get the other TD value of the same line TR

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.