|
 |
|
ถ้าจะไม่ให้หน้า form ส่งข้อมูล โดยการกดปุ่ม Enter ทำไงอะครับ คือถ้าจะส่งหน้า form ให้ใช้ mous click อย่างเดียวเลยอะครับ |
|
 |
|
|
 |
 |
|
ถ้าจะไม่ให้หน้า form ส่งข้อมูล โดยการกดปุ่ม Enter ทำไงอะครับ คือถ้าจะส่งหน้า form ให้ใช้ mous click อย่างเดียวเลยอะครับ
Code (PHP)
<form name="frmMain" method="post" action="<?=$_SERVER["PHP_SELF"];?>">
<input type="hidden" name="hdnCmd" value="">
<table width="950" border="0" align="left" cellpadding="0" cellspacing="0">
<tr><td><br></td></tr>
<tr><td align="center" colspan="8"><font size="+1"> ขายสินค้า</td></tr>
<tr><td colspan="7"><br></td></tr>
<tr><td width="450"><div align="right">เลขที่บิล :</td>
<td width="250"><div align="right">
<input type="text" name="Rec_Id" id="Rec_Id" value= "<?=$all?>" "class=input disabled="disabled"/>
<input type="hidden" name="Rec_Id" id="Rec_Id" value= "<?=$all?>"/>
</div></td>
<td width ="500"><div align="right">รหัสสินค้า :</td>
<td width="190" colspan="4"><div align="right">
<input type="text" value="<? echo $Drg_Id ?>" size="61" name="Drg_Id" id="Drg_Id" />
<!--<input type="text" value="<? echo $Drg_Id ?>" "class=input disabled="disabled" size="61" name="Drg_Id2" id="Drg_Id2" />-->
<a href="#" onClick="javascript:window.open('zzz_POPUP2.php?Pt_Id=<?=$Pt_Id;?>&Pt_Fname=<?=$Pt_Fname;?>&Pt_Lname=<?=$Pt_Lname;?>' , '','width=700,height=350,top=220,left=650 ' )";><img = src="image/search.png" width="20" height="17"/></a>
<!--<input name="openPopup2" type="image" src="image/search.png" width="20" height="17" id="openPopup2" onClick="Javascript:windowOpen2();" value="Get"> -->
</div></td>
<tr>
<td><td>
<td><div align="right">บาร์โค้ด :</td>
<td width="190" colspan="4"><div align="right">
<input type="text" value="<? echo $Drg_Barcode ?>" size="68" name="Drg_Barcode" id="Drg_Barcode" autofocus />
</div></td>
</tr>
<tr><td><div align="right">รหัสพนักงาน :</td>
<td width="190"><div align="right">
<input type="text" name="UserName" id="UserName" value="<?=$UserName?>" "class=input disabled="disabled"/>
<input type="hidden" name="UserName" id="UserName" value="<?=$UserName?>"/>
</div></td>
<td><div align="right">ชื่อทางการค้า :</td>
<td width="190" colspan="4"><div align="right">
<input type="text" value="<? echo $Drg_Name ?>" size="68" name="Drg_Name" id="Drg_Name"/>
</div></td>
</tr>
<tr><td><div align="right">ชื่อ :</td>
<td width="190"><div align="right">
<input type="text" name="Usr_Fname" id="Usr_Fname" value="<?=$Usr_Fname?>" "class=input disabled="disabled"/>
<input type="hidden" name="Usr_Fname" id="Usr_Fname" value="<?=$Usr_Fname?>"/>
</div></td>
<td width="130"><div align="right">ชื่อสามัญทางยา :</td>
<td width="190" colspan="4"><div align="right">
<input type="text" value="<? echo $Comm_Name ?>" size="68" name="Comm_Name" id="Comm_Name" />
</div></td>
</tr>
<tr><td><div align="right">นามสกุล :</td>
<td width="190"><div align="right">
<input type="text" name="Usr_Lname" id="Usr_Lname" value="<?=$Usr_Lname?>" "class=input disabled="disabled"/>
<input type="hidden" name="Usr_Lname" id="Usr_Lname" value="<?=$Usr_Lname?>"/>
</div></td>
<td width="230"><div align="right">ประเภทสินค้า :</td>
<td width="190" colspan="4"><div align="right">
<input type="text" size="68" name="Udrg_Rw" id="Udrg_Rw" value="<? echo $Udrg_Rw ?>" />
</div></td>
</tr>
<tr><td><br></td>
<td></td>
<td><div align="right"><!--จำนวนที่มี :--></td>
<td width="140"><div align="right">
<!--<input type="text" size="9" name="NameCustomer" id="NameCustomer" "class=input disabled="disabled"/>-->
</div></td>
<td width="90"><div align="right"><!--หมดอายุ :--></td>
<td width="150" colspan="2"><div align="right">
<!--<input type="text" size="23" name="NameCustomer" id="NameCustomer" "class=input disabled="disabled"/>-->
</div></td>
</tr>
<tr><td><div align="right">รหัสลูกค้า :</td>
<td width="190"><div align="right">
<input type="text" value="<? echo $Pt_Id ?>" name="Pt_Id" id="Pt_Id" size="13">
<!-- <input type="text" value="<? echo $Pt_Id ?>" "class=input disabled="disabled" name="Pt_Id2" id="Pt_Id2" size="13">-->
<a href="#" onClick="javascript:window.open('zzz_POPUP.php' , '','width=670,height=350,top=220,left=650 ' )";><img = src="image/search.png" width="20" height="17"/></a>
<!--<input name="openPopup" type="image" src="image/search.png" width="20" height="17" id="openPopup" onClick="Javascript:windowOpen();" value="Get"> -->
</div></td>
<td><div align="right"></td>
<td width="190" colspan="4"><div align="right">
</div></td>
</tr>
<tr><td><div align="right">ชื่อ :</td>
<td width="190"><div align="right">
<input type="text" value="<? echo $Pt_Fname ?>" name="Pt_Fname" id="Pt_Fname">
</div></td>
<td><div align="right">จำนวนซื้อ </td>
<td><div align="center">หน่วยสินค้า </td>
<td><div align="center">ราคา/หน่วย </td>
<td><div align="center">เป็นเงิน </td>
<td></td>
</tr>
<tr><td><div align="right">นามสกุล :</td>
<td width="190"><div align="right">
<input type="text" value="<? echo $Pt_Lname ?>" name="Pt_Lname" id="Pt_Lname">
</div></td>
<td width="115"><div align="right">
<input type="text" size="7" name="Drg_Qtt" id="Drg_Qtt" onkeyup="javascript:intOnly(this);" & OnChange="fncSum();" style="text-align:right;padding-right:2px;"/>
</div></td>
<td width="115"><div align="center">
<input type="text" size="7" name="Unt_Name" id="Unt_Name" value="<? echo $Unt_Name ?>" />
</div></td>
<td width="115"><div align="center">
<input type="text" size="7" name="Price_Sale" id="Price_Sale" value="<? echo $Price_Sale ?>" style="text-align:right;padding-right:2px;"/>
<!--<input type="text" size="7" name="Price_Sale2" id="Price_Sale2" value="<? echo $Price_Sale ?>" "class=input disabled="disabled" style="text-align:right;padding-right:2px;"/>-->
</div></td>
<td width="115"><div align="center">
<input type="text" size="7" name="Total" id="Total" style="text-align:right;padding-right:2px;"/><span hidden="" id="Total" ></span>
<!--<input type="text" size="7" name="Total2" id="Total2" "class=input disabled="disabled" style="text-align:right;padding-right:2px;"/><span hidden="" id="Total2" ></span>-->
</div></td>
<td width="115"><div align="center">
<input name="btnAdd" type="image" src="image/add.png" width="25" height="25" id="btnAdd" value="Add" onclick="frmMain.hdnCmd.value='Add';frmMain.submit();">
Tag : PHP, MySQL, JavaScript, Action Script, Ajax, jQuery

|
|
 |
 |
 |
 |
Date :
2013-12-21 08:19:40 |
By :
nick15 |
View :
694 |
Reply :
4 |
|
 |
 |
 |
 |
|
|
|
 |
 |
|
 |
 |
 |
|
|
 |
 |
|
jQuery ajax ก็เป็นอีกทางเลือก ครับ
|
 |
 |
 |
 |
Date :
2013-12-21 08:26:12 |
By :
geidtiphong |
|
 |
 |
 |
 |
|
|
 |
 |
|
 |
 |
 |
|
|
 |
 |
|
ลองแบบนี้ได้ไหม
<form id="loginform" name="loginform" method="post" action="../admin/checkadmin.php" >
.
.
.
<input type="button" onClick="checkvalue()" style="margin: -20px 0 0 287px;" class="button" name="commit" value="Log in"/>
|
 |
 |
 |
 |
Date :
2013-12-21 09:20:32 |
By :
apisitp |
|
 |
 |
 |
 |
|
|
 |
 |
|
 |
 |
 |
|
|
 |
 |
|
Code (PHP)
<script src="http://code.jquery.com/jquery-1.8.3.js"></script>
<meta http-equiv="Content-Type" content="text/html; charset=utf8" />
<script type="text/javascript">
$(document).ready(function(){
$("form[name='frmMain']").submit(function(event){
event.preventDefault();
});
});
</script>
|
 |
 |
 |
 |
Date :
2013-12-23 17:00:28 |
By :
sakuraei |
|
 |
 |
 |
 |
|
|
 |
 |
|
 |
 |
|
|
|

|
Load balance : Server 03
|