<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml"> <head> <meta http-equiv="Content-Type" content="text/html; charset=windows-874" /> <title>Untitled Document</title> <script language="JavaScript" type="text/javascript" src="หาเอาคับ"></script> <script src="chk_lot_no.js" type="text/javascript"></script> <script type="text/javascript"> function addfieldset() { var sn = $("#sum_sn").val(); var total= 0; var namefieldset = document.getElementById("sn").cloneNode(true); for(i=0;i<=sn.length;i++){ document.getElementById("names").appendChild( namefieldset ); total=$("#sum_sn").val()+ document.all.add_sn[i].value; $("#sum_sn").val(total); alert(i); alert(total); } } function deletefieldset( e ) { var namefieldset = e.parentNode; namefieldset.parentNode.removeChild( namefieldset ); } </script> <style type="text/css"> td { font-family:Verdana, Arial, Helvetica, sans-serif; font-size:12px; } .title { font-family:sans-serif; font-size:12px; font-weight:bold; color:#688EF4; } </style> </head> <body> <form name="frm" id="frm"> <table width="400" border="0"> <tr> <td width="30%"> </td> <td class="title">จัดการ SN CODE ที่ชำรุด</td> </tr> <tr> <td colspan="2"> <div id="names"> <div id="sn">SN: <input name="add_sn" id="add_sn" type="text"/> <a href="#" onclick="deletefieldset( this )">delete</a> </div> </div> <input id="add" type="button" value="Add SN" onclick="addfieldset()"/> <input type="text" name="sum_sn" id="sum_sn" value="" /></td> </tr> <tr> <td colspan="2"> </td> </tr> <tr> <td colspan="2"><input type="button" name="update" id="update" value="บันทึก" /></td> </tr> </table> </form> </body> </html>
total=$("#sum_sn").val()+ ParseFloat(document.all.add_sn[i].value);
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml"> <head> <meta http-equiv="Content-Type" content="text/html; charset=windows-874" /> <title>Untitled Document</title> <script language="JavaScript" type="text/javascript" src=""></script> <script src="../js/chk_lot_no.js" type="text/javascript"></script> <script type="text/javascript"> function addfieldset() { var total= ''; var namefieldset = $("#sn").clone(true); $('.all_sn').each(function(index) { $("#names").append( namefieldset ); total+= $(this).val()+','; $("#sum_sn").val(total); }); } </script> <style type="text/css"> td { font-family:Verdana, Arial, Helvetica, sans-serif; font-size:12px; } .title { font-family:sans-serif; font-size:12px; font-weight:bold; color:#688EF4; } </style> </head> <body> <table width="400" border="0"> <tr> <td width="30%"> </td> <td class="title">จัดการ SN CODE ที่ชำรุด</td> </tr> <tr> <td colspan="2"> <div id="names"> <div id="sn">SN: <input name="add_sn" id="add_sn" class="all_sn" type="text" /> </div> </div> <input id="add" type="button" value="Add SN" onclick="addfieldset()"/> <input type="text" name="sum_sn" id="sum_sn" value="" /></td> </tr> <tr> <td colspan="2"> </td> </tr> <tr> <td colspan="2"><input type="button" name="update" id="update" value="บันทึก" /> <input type="button" name="clear" id="clear" value="เริ่มใหม่" /></td> </tr> </table> </body> </html>
เพื่อความปลอดภัยของเว็บบอร์ด ไม่อนุญาติให้แทรก แท็ก [img]....[/img] โดยการอัพโหลดไฟล์รูปจากที่อื่น เช่นเว็บไซต์ ฟรีอัพโหลดต่าง ๆ อัพโหลดแทรกรูปภาพ ให้ใช้บริการอัพโหลดไฟล์ของไทยครีเอท และตัดรูปภาพให้พอดีกับสกรีน เพื่อความโหลดเร็วและไฟล์ไม่ถูกลบทิ้ง