Home > front end >  After click the submit, how to keep only to complete the following a line, the input box to remove t
After click the submit, how to keep only to complete the following a line, the input box to remove t

Time:12-11

$(" # submit ") on (' click ', function () {
Let tableObj=document. GetElementById (" tableId ");

Let rows=tableObj. Rows;
For (the let I=1; i Let cells=rows [I] cells;
Let the id=cells [0]. InnerHTML;
Let Vessel=cells [1]. The innerHTML;
Let Voyage=cells [2]. InnerHTML;
Let CtnWegtCla=cells [3]. The innerHTML;
Let CtnSize=cells [4]. InnerHTML;
Let CtnWegtRanLeft=cells [5]. The getElementsByTagName (" input ") [0]. Value;
Let CtnWegtRanRight=cells [6]. GetElementsByTagName (" input ") [0]. Value;

Let data={
https://bbs.csdn.net/topics/'id: id,
'Vessel, Vessel,
'Voyage: Voyage,
'CtnWegtCla: CtnWegtCla,
'CtnSize: CtnSize,
'CtnWegtRanLeft: CtnWegtRanLeft,
'CtnWegtRanRight: CtnWegtRanRight,

};
$. Ajax ({
Url:/berth/add_port_grade "/",
Type: "POST",
Data: JSON. Stringify (data),

Success: the function () {
Alert (' submit success);
$(this). The remove ();
Let tbodyObj=document. GetElementsByTagName (' tbody ');
Let newTr=document. The createElement method (' tr);
Let newTd=`
The ${id} & lt;/td>
The ${Vessel} & lt;/td>
The ${Voyage} & lt;/td>
The ${CtnWegtCla} & lt;/td>
The ${CtnSize} & lt;/td>
The ${CtnWegtRanLeft} & lt;/td>
The ${CtnWegtRanRight} & lt;/td>

{1}
`;
NewTr. InnerHTML=newTd;
TbodyObj [0]. The appendChild (newTr);

}
})
}})

CodePudding user response:

Is anyone here [face] monkey2:002 PNG [/face]
  • Related