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