Register Register Member Login Member Login Member Login Forgot Password ??
PHP , ASP , ASP.NET, VB.NET, C#, Java , jQuery , Android , iOS , Windows Phone
 

Registered : 109,027

HOME > PHP > PHP Forum > ต้องที่จะ คลิกรูปแล้ว รูปส่งค่าไปแสดงใน textbox ในเพจเดียวกัน ส่งค่าเป็นตัวเลข แต่ละรูปมีค่าตัวเลขไม่เหมือนกัน



 

ต้องที่จะ คลิกรูปแล้ว รูปส่งค่าไปแสดงใน textbox ในเพจเดียวกัน ส่งค่าเป็นตัวเลข แต่ละรูปมีค่าตัวเลขไม่เหมือนกัน

 



Topic : 082375



โพสกระทู้ ( 20 )
บทความ ( 0 )



สถานะออฟไลน์




ตามหัวข้อครับ

คลิกที่รูปแล้ว ส่งตัวเลขไปใส่ใน text เมื่อเราพิพ์ลงไปเลยครับ ในเพจเดียวกันนะครับ



Tag : PHP







Move To Hilight (Stock) 
Send To Friend.Bookmark.
Date : 2012-08-15 16:13:04 By : kingofdaeth View : 969 Reply : 6
 

 

No. 1



โพสกระทู้ ( 1,521 )
บทความ ( 2 )

สมาชิกที่ใส่เสื้อไทยครีเอท Hall of Fame 2012

สถานะออฟไลน์
Facebook

javaScript ครับ






แสดงความคิดเห็นโดยอ้างถึง ความคิดเห็นนี้
Date : 2012-08-15 16:21:03 By : Krungsri
 


 

No. 2



โพสกระทู้ ( 322 )
บทความ ( 1 )



สถานะออฟไลน์


ราวๆเนี้ยผมไม่ได้ลองนะ เขียนในนี้เลย
Code (PHP)
<script>
function Num(n){

var nn=n;

document.getelementById['a'].value=nn;

}
</script>




<body>
<input type="text" id="a" >
<img onClick="Num(1);" >
<img onClick="Num(2);" >
<img onClick="Num(2);" >
</body>

แสดงความคิดเห็นโดยอ้างถึง ความคิดเห็นนี้
Date : 2012-08-15 16:21:14 By : tongspy
 

 

No. 3



โพสกระทู้ ( 20 )
บทความ ( 0 )



สถานะออฟไลน์


ไม่ได้ ครับ
แสดงความคิดเห็นโดยอ้างถึง ความคิดเห็นนี้
Date : 2012-08-15 19:34:58 By : kingofdaeth
 


 

No. 4



โพสกระทู้ ( 20 )
บทความ ( 0 )



สถานะออฟไลน์


Code (PHP)
<?
session_start();
				?>
<?php
$host = "localhost";
$user = "root";
$passwd ="pp1241";
$dbname = "Register";
mysql_connect($host,$user,$passwd) or die ("ติดต่อ Host ไม่ได้");
mysql_select_db ($dbname) or die ("ติดต่อฐานข้อมูลไม่ได้");
mysql_query("set NAMES utf8");
$sql101  = "SELECT *FROM `floor 1`WHERE `room` =101 ";
$dbquery101 = mysql_db_query($dbname , $sql101);
while ($array = mysql_fetch_array($dbquery101))
			{
				$r101 = $array['room'];
				$r101_user = $array['username'];
				$r101_money = $array['money'];
				$r101_date = $array['date'];
			}
			$sql102  = "SELECT *FROM `floor 1`WHERE `room` =102 ";
$dbquery102 = mysql_db_query($dbname , $sql102);
while ($array = mysql_fetch_array($dbquery102))
			{
				$r102 = $array['room'];
				$r102_user = $array['username'];
				$r102_money = $array['money'];
				$r102_date = $array['date'];
			}
			$sql103  = "SELECT *FROM `floor 1`WHERE `room` =103 ";
$dbquery103 = mysql_db_query($dbname , $sql103);
while ($array = mysql_fetch_array($dbquery103))
			{
				$r103 = $array['room'];
				$r103_user = $array['username'];
				$r103_money = $array['money'];
				$r103_date = $array['date'];
			}
			$sql104  = "SELECT *FROM `floor 1`WHERE `room` =104 ";
$dbquery104 = mysql_db_query($dbname , $sql104);
while ($array = mysql_fetch_array($dbquery104))
			{
				$r104 = $array['room'];
				$r104_user = $array['username'];
				$r104_money = $array['money'];
				$r104_date = $array['date'];
			}
			$sql105  = "SELECT *FROM `floor 1`WHERE `room` =105 ";
$dbquery105 = mysql_db_query($dbname , $sql105);
while ($array = mysql_fetch_array($dbquery105))
			{
				$r105 = $array['room'];
				$r105_user = $array['username'];
				$r105_money = $array['money'];
				$r105_date = $array['date'];
			}
			$sql106  = "SELECT *FROM `floor 1`WHERE `room` =106 ";
$dbquery106 = mysql_db_query($dbname , $sql106);
while ($array = mysql_fetch_array($dbquery106))
			{
				$r106 = $array['room'];
				$r106_user = $array['username'];
				$r106_money = $array['money'];
				$r106_date = $array['date'];
			}
			$sql107  = "SELECT *FROM `floor 1`WHERE `room` =107 ";
$dbquery107 = mysql_db_query($dbname , $sql107);
while ($array = mysql_fetch_array($dbquery107))
			{
				$r107 = $array['room'];
				$r107_user = $array['username'];
				$r107_money = $array['money'];
				$r107_date = $array['date'];
			}
			$sql108  = "SELECT *FROM `floor 1`WHERE `room` =108 ";
$dbquery108 = mysql_db_query($dbname , $sql108);
while ($array = mysql_fetch_array($dbquery108))
			{
				$r108 = $array['room'];
				$r108_user = $array['username'];
				$r108_money = $array['money'];
				$r108_date = $array['date'];
			}
			$sql109  = "SELECT *FROM `floor 1`WHERE `room` =109 ";
$dbquery109 = mysql_db_query($dbname , $sql109);
while ($array = mysql_fetch_array($dbquery109))
			{
				$r109 = $array['room'];
				$r109_user = $array['username'];
				$r109_money = $array['money'];
				$r109_date = $array['date'];
			}
			$sql110  = "SELECT *FROM `floor 1`WHERE `room` =110 ";
$dbquery110 = mysql_db_query($dbname , $sql110);
while ($array = mysql_fetch_array($dbquery110))
			{
				$r110 = $array['room'];
				$r110_user = $array['username'];
				$r110_money = $array['money'];
				$r110_date = $array['date'];
			}
			$sql111  = "SELECT *FROM `floor 1`WHERE `room` =111 ";
$dbquery111 = mysql_db_query($dbname , $sql111);
while ($array = mysql_fetch_array($dbquery111))
			{
				$r111 = $array['room'];
				$r111_user = $array['username'];
				$r111_money = $array['money'];
				$r111_date = $array['date'];
			}
			$sql112  = "SELECT *FROM `floor 1`WHERE `room` =112 ";
$dbquery112 = mysql_db_query($dbname , $sql112);
while ($array = mysql_fetch_array($dbquery112))
			{
				$r112 = $array['room'];
				$r112_user = $array['username'];
				$r112_money = $array['money'];
				$r112_date = $array['date'];
			}
			$sql113  = "SELECT *FROM `floor 1`WHERE `room` =113 ";
$dbquery113 = mysql_db_query($dbname , $sql113);
while ($array = mysql_fetch_array($dbquery113))
			{
				$r113 = $array['room'];
				$r113_user = $array['username'];
				$r113_money = $array['money'];
				$r113_date = $array['date'];
			}
			$sql114  = "SELECT *FROM `floor 1`WHERE `room` =114 ";
$dbquery114 = mysql_db_query($dbname , $sql114);
while ($array = mysql_fetch_array($dbquery114))
			{
				$r114 = $array['room'];
				$r114_user = $array['username'];
				$r114_money = $array['money'];
				$r114_date = $array['date'];
			}
			$sql115  = "SELECT *FROM `floor 1`WHERE `room` =115 ";
$dbquery115 = mysql_db_query($dbname , $sql115);
while ($array = mysql_fetch_array($dbquery115))
			{
				$r115 = $array['room'];
				$r115_user = $array['username'];
				$r115_money = $array['money'];
				$r115_date = $array['date'];
			}
			$sql116  = "SELECT *FROM `floor 1`WHERE `room` =116 ";
$dbquery116 = mysql_db_query($dbname , $sql116);
while ($array = mysql_fetch_array($dbquery116))
			{
				$r116 = $array['room'];
				$r116_user = $array['username'];
				$r116_money = $array['money'];
				$r116_date = $array['date'];
			}
			$sql117  = "SELECT *FROM `floor 1`WHERE `room` =117 ";
$dbquery117 = mysql_db_query($dbname , $sql117);
while ($array = mysql_fetch_array($dbquery117))
			{
				$r117 = $array['room'];
				$r117_user = $array['username'];
				$r117_money = $array['money'];
				$r117_date = $array['date'];
			}
			$sql118  = "SELECT *FROM `floor 1`WHERE `room` =118 ";
$dbquery118 = mysql_db_query($dbname , $sql118);
while ($array = mysql_fetch_array($dbquery118))
			{
				$r118 = $array['room'];
				$r118_user = $array['username'];
				$r118_money = $array['money'];
				$r118_date = $array['date'];
			}
			
			$sqluser  = "SELECT *FROM `floor 1`WHERE `username` LIKE '$_SESSION[musername]' ";
$dbqueryuser = mysql_db_query($dbname , $sqluser);
$rent = 0;
while ($array = mysql_fetch_array($dbqueryuser))
			{
				$userroom = $array['room'];
				$user_user = $array['username'];
				$user_money = $array['money'];
				$user_date = $array['date'];
				$rent = $rent+$user_money;
			}
			
			mysql_close();
		
?>
<html>
<head>

<title>เพจจองห้อง ชั้น1</title>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<style type="text/css">
form {
	font-size: 14px;
}
form {
	color: #00F;
	
}
#Table_01 tr td {
	color: rgb(0,0,255);
	font-size: 16px;
}
#Table_01 {
	text-align: right;
}
td {
	text-align: center;
	
}
</style>
</head>
<center>

<body bgcolor="#FFFFFF" leftmargin="0" topmargin="0" marginwidth="0" marginheight="0" background="images/bg1111.gif">
<!-- Save for Web Slices (เพจจองห้อง ชั้น1.psd) -->
<table id="Table_01" width="800" height="511" border="0" cellpadding="0" cellspacing="0">
	<tr>
		<td colspan="9" background="images/floor-1_01.gif" id="Table_01">
        <?php

$host = "localhost";
$user = "root";
$passwd ="pp1241";
$dbname = "Register";
mysql_connect($host,$user,$passwd) or die ("ติดต่อ Host ไม่ได้");
mysql_select_db ($dbname) or die ("ติดต่อฐานข้อมูลไม่ได้");
mysql_query("SET NAMES UTF8");
mysql_query("SET character_set_results=utf8");
mysql_query("SET character_set_client=utf8");
mysql_query("SET character_set_connection=utf8");
$sql  = "SELECT *FROM `user`WHERE `username` LIKE '$_SESSION[musername]' ";
$dbquery = mysql_db_query($dbname , $sql);
$num_rows = mysql_num_rows($dbquery);
while ($array = mysql_fetch_array($dbquery))
			{
				$a_id = $array['id'];
				$a_username = $array['username'];
				$a_password = $array['password'];
				$a_name = $array['name'];
				$a_lastname = $array['lastname'];
				$a_id_card =  $array['Id_card'];
				$a_sex = $array['sex'];
				$a_age = $array['age'];
				$a_tel = $array['tel'];
				$a_email = $array['email'];
				$a_address = $array['address'];
				$a_work = $array['work'];
				$a_money = $array['money'];	
			}  
			$total = $a_money - $rent;
				print  "ยอดเงินรวมทั้งหมด $total  บาท";
			
			
        ?>
        &nbsp;</td>
		<td colspan="4"><a href="floor-1.php"><img src="images/floor-1_02.gif" alt="" width="86" height="42" border="0" align="texttop" ></a></td>
		<td colspan="2">
			<img src="images/floor-1_03.gif" alt="" width="23" height="42" align="texttop"></td>
		<td colspan="4"><a href="floor-2.php"><img src="images/floor-1_04.gif" alt="" width="81" height="42" align="texttop"></a></td>
		<td>
			<img src="images/floor-1_05.gif" alt="" width="26" height="42" align="texttop"></td>
		<td colspan="3"><a href="floor-3.php"><img src="images/floor-1_06.gif" alt="" width="79" height="42" align="texttop"></a></td>
		<td>
			<img src="images/floor-1_07.gif" alt="" width="28" height="42" align="texttop"></td>
		<td colspan="3"><a href="floor-4.php"><img src="images/floor-1_08.gif" alt="" width="78" height="42" align="texttop"></a></td>
		<td>
			<img src="images/floor-1_09.gif" alt="" width="38" height="42" align="texttop"></td>
	</tr>
	<tr>
		<td rowspan="5">
			<img src="images/floor-1_10.gif" alt="" width="122" height="468" align="texttop"></td>
		<td width="678" height="42" colspan="27" background="images/floor-1_11.gif">&nbsp;</td>
	</tr>
	<tr>
		<td><?
			if ($r101_user=="")
			{
			print "<img src=images/floor-1_12.gif  alt= width=56 height=107 align=texttop >";
			}
			else
			{
				print "<img src=images/floor-1-rad_12.gif  alt= width=56 height=107 align=texttop >";
			}
			?></td>
		<td>
	  <img src="images/floor-1_13.gif" alt="" width="11" height="107" align="texttop"></td>
		<td><?
			if ($r103_user=="")
			{
			print "<img src=images/floor-1_14.gif  alt= width=56 height=107 align=texttop >";
			}
			else
			{
				print "<img src=images/floor-1-rad_14.gif  alt= width=56 height=107 align=texttop >";
			}
			?><td>
			<img src="images/floor-1_15.gif" width="11" height="107" alt=""></td>
		<td colspan="2">
			<?
			if ($r105_user=="")
			{
			print "<img src=images/floor-1_16.gif  alt= width=56 height=107 align=texttop >";
			}
			else
			{
				print "<img src=images/floor-1-rad_16.gif  alt= width=56 height=107 align=texttop >";
			}
			?><td>
			<img src="images/floor-1_17.gif" width="11" height="107" alt=""></td>
		<td colspan="2">
			<?
			if ($r107_user=="")
			{
			print "<img src=images/floor-1_18.gif  alt= width=56 height=107 align=texttop >";
			}
			else
			{
				print "<img src=images/floor-1-rad_18.gif  alt= width=56 height=107 align=texttop >";
			}
			?><td>
			<img src="images/floor-1_19.gif" alt="" width="11" height="107" align="texttop"></td>
		<td>
			<?
			if ($r109_user=="")
			{
			print "<img src=images/floor-1_20.gif  alt= width=56 height=107 align=texttop >";
			}
			else
			{
				print "<img src=images/floor-1-rad_20.gif  alt= width=56 height=107 align=texttop >";
			}
			?></td>
		<td colspan="2">
			<img src="images/floor-1_21.gif" alt="" width="11" height="107" align="texttop"></td>
		<td colspan="2"><?
			if ($r111_user=="")
			{
			print "<img src=images/floor-1_22.gif  alt= width=56 height=107 align=texttop >";
			}
			else
			{
				print "<img src=images/floor-1-rad_22.gif  alt= width=56 height=107 align=texttop >";
			}
			?></td>
		<td>
			<img src="images/floor-1_23.gif" alt="" width="10" height="107" align="texttop"></td>
		<td colspan="3"><?
			if ($r113_user=="")
			{
			print "<img src=images/floor-1_24.gif  alt= width=56 height=107 align=texttop >";
			}
			else
			{
				print "<img src=images/floor-1-rad_24.gif  alt= width=56 height=107 align=texttop >";
			}
			?></td>
		<td>
			<img src="images/floor-1_25.gif" alt="" width="12" height="107" align="texttop"></td>
		<td>
			<?
			if ($r115_user=="")
			{
			print "<img src=images/floor-1_26.gif  alt= width=56 height=107 align=texttop >";
			}
			else
			{
				print "<img src=images/floor-1-rad_26.gif  alt= width=56 height=107 align=texttop >";
			}
			?></td>
		<td>
			<img src="images/floor-1_27.gif" alt="" width="11" height="107" align="texttop"></td>
		<td colspan="3">
			<?
			if ($r117_user=="")
			{
			print "<img src=images/floor-1_28.gif  alt= width=56 height=107 align=texttop >";
			}
			else
			{
				print "<img src=images/floor-1-rad_28.gif  alt= width=56 height=107 align=texttop >";
			}
			?></td>
		<td colspan="2" rowspan="4">
			<img src="images/floor-1_29.gif" alt="" width="89" height="426" align="texttop"></td>
	</tr>
	<tr>
		<td colspan="24">
			<img src="images/floor-1_30.gif" alt="" width="588" height="60" align="texttop"></td>
		<td>
			<img src="images/floor-1_31.gif" width="1" height="60" alt=""></td>
	</tr>
	<tr>
		<td>
			<?
			if ($r102_user=="")
			{
			print "<img src=images/floor-1_32.gif  alt= width=56 height=107 align=texttop >";
			}
			else
			{
				print "<img src=images/floor-1-rad_32.gif  alt= width=56 height=107 align=texttop >";
			}
			?></td>
		<td>
			<img src="images/floor-1_33.gif" alt="" width="11" height="107" align="texttop"></td>
		<td>
			<?
			if ($r104_user=="")
			{
			print "<img src=images/floor-1_34.gif  alt= width=56 height=107 align=texttop >";
			}
			else
			{
				print "<img src=images/floor-1-rad_34.gif  alt= width=56 height=107 align=texttop >";
			}
			?></td>
		<td colspan="2">
			<img src="images/floor-1_35.gif" alt="" width="12" height="107" align="texttop"></td>
		<td>
			<?
			if ($r106_user=="")
			{
			print "<img src=images/floor-1_36.gif  alt= width=56 height=107 align=texttop >";
			}
			else
			{
				print "<img src=images/floor-1-rad_36.gif  alt= width=56 height=107 align=texttop >";
			}
			?></td>
		<td>
			<img src="images/floor-1_37.gif" alt="" width="11" height="107" align="texttop"></td>
		<td colspan="2">
			<?
			if ($r108_user=="")
			{
			print "<img src=images/floor-1_38.gif  alt= width=56 height=107 align=texttop >";
			}
			else
			{
				print "<img src=images/floor-1-rad_38.gif  alt= width=56 height=107 align=texttop >";
			}
			?></td>
		<td>
			<img src="images/floor-1_39.gif" alt="" width="11" height="107" align="texttop"></td>
		<td>
			<?
			if ($r110_user=="")
			{
			print "<img src=images/floor-1_40.gif  alt= width=56 height=107 align=texttop >";
			}
			else
			{
				print "<img src=images/floor-1-rad_40.gif  alt= width=56 height=107 align=texttop >";
			}
			?></td>
		<td colspan="2">
			<img src="images/floor-1_41.gif" alt="" width="11" height="107" align="texttop"></td>
		<td colspan="2">
			<?
			if ($r112_user=="")
			{
			print "<img src=images/floor-1_42.gif  alt= width=56 height=107 align=texttop >";
			}
			else
			{
				print "<img src=images/floor-1-rad_42.gif  alt= width=56 height=107 align=texttop >";
			}
			?></td>
		<td colspan="2"><img src="images/floor-1_45.gif" alt="" width="12" height="107" align="texttop"></td>
		<td colspan="2">
			<?
			if ($r114_user=="")
			{
			print "<img src=images/floor-1_44.gif  alt= width=56 height=107 align=texttop >";
			}
			else
			{
				print "<img src=images/floor-1-rad_44.gif  alt= width=56 height=107 align=texttop >";
			}
			?></td>
		<td>
			<img src="images/floor-1_45.gif" alt="" width="12" height="107" align="texttop"></td>
		<td>
			<?
			if ($r116_user=="")
			{
			print "<img src=images/floor-1_46.gif  alt= width=56 height=107 align=texttop >";
			}
			else
			{
				print "<img src=images/floor-1-rad_46.gif  alt= width=56 height=107 align=texttop >";
			}
			?></td>
		<td>
			<img src="images/floor-1_47.gif" alt="" width="11" height="107" align="texttop"></td>
		<td colspan="3">
			<?
			if ($r118_user=="")
			{
			print "<img src=images/floor-1_48.gif  alt= width=56 height=107 align=texttop >";
			}
			else
			{
				print "<img src=images/floor-1-rad_48.gif  alt= width=56 height=107 align=texttop >";
			}
			?></td>
	</tr>
	<tr>
		<td colspan="24" align="center" background="images/floor-1_49.gif"><form name="form1" method="post" action="checkfloor1" onsubmit="return check()">
		  <p>&nbsp;</p>
          <?
		  date_default_timezone_set('Asia/Bangkok');
		  $_SESSION[date] = date("Y/n/d " );
		  print "    <label for=total></label>";
	    print "	  <input name=total type=hidden id=total  value=$total  > ";
		  if ($total>0){
			
		 print " <p>ต้องการจองห้องเบอร์ ";
		print "    <label for=number></label>";
	    print "	  <input name=number type=text id=number size=3 maxlength=3  > ";
	    print "	  จองเท่าไร ";
		print "  <label for=money></label>";
		 print " <input name=money type=text id=money size=5 maxlength=5 >";
		 print "      ";
		  print "<input type=submit name=button id=button value=ตกลง  >";
	  print "	  </p>";
        print "</form>";
		  }else
		  {
		 print " <p>ต้องการจองห้องเบอร์ ";
		print "    <label for=number></label>";
	    print "	  <input name=number type=text id=number size=3 maxlength=3 readonly  > ";
	    print "	  จองเท่าไร ";
		print "  <label for=money></label>";
		 print " <input name=money type=text id=money size=5 maxlength=5 readonly>";
		 print "      ";
		  print "<input type=submit name=button id=button value=ตกลง >";
	  print "	  </p>";
        print "</form>";}
		 ?>
			</td>
		<td>
			<img src="images/floor-1_50.gif" width="1" height="152" alt=""></td>
	</tr>
	<tr>
		<td>
			<img src="images/spacer.gif" width="122" height="1" alt=""></td>
		<td>
			<img src="images/spacer.gif" width="56" height="1" alt=""></td>
		<td>
			<img src="images/spacer.gif" width="11" height="1" alt=""></td>
		<td>
			<img src="images/spacer.gif" width="55" height="1" alt=""></td>
		<td>
			<img src="images/spacer.gif" width="11" height="1" alt=""></td>
		<td>
			<img src="images/spacer.gif" width="1" height="1" alt=""></td>
		<td>
			<img src="images/spacer.gif" width="55" height="1" alt=""></td>
		<td>
			<img src="images/spacer.gif" width="11" height="1" alt=""></td>
		<td>
			<img src="images/spacer.gif" width="39" height="1" alt=""></td>
		<td>
			<img src="images/spacer.gif" width="16" height="1" alt=""></td>
		<td>
			<img src="images/spacer.gif" width="11" height="1" alt=""></td>
		<td>
			<img src="images/spacer.gif" width="56" height="1" alt=""></td>
		<td>
			<img src="images/spacer.gif" width="3" height="1" alt=""></td>
		<td>
			<img src="images/spacer.gif" width="8" height="1" alt=""></td>
		<td>
			<img src="images/spacer.gif" width="15" height="1" alt=""></td>
		<td>
			<img src="images/spacer.gif" width="41" height="1" alt=""></td>
		<td>
			<img src="images/spacer.gif" width="10" height="1" alt=""></td>
		<td>
			<img src="images/spacer.gif" width="2" height="1" alt=""></td>
		<td>
			<img src="images/spacer.gif" width="28" height="1" alt=""></td>
		<td>
			<img src="images/spacer.gif" width="26" height="1" alt=""></td>
		<td>
			<img src="images/spacer.gif" width="12" height="1" alt=""></td>
		<td>
			<img src="images/spacer.gif" width="56" height="1" alt=""></td>
		<td>
			<img src="images/spacer.gif" width="11" height="1" alt=""></td>
		<td>
			<img src="images/spacer.gif" width="28" height="1" alt=""></td>
		<td>
			<img src="images/spacer.gif" width="26" height="1" alt=""></td>
		<td>
			<img src="images/spacer.gif" width="1" height="1" alt=""></td>
		<td>
			<img src="images/spacer.gif" width="51" height="1" alt=""></td>
		<td>
			<img src="images/spacer.gif" width="38" height="1" alt=""></td>
	</tr>
</table>
<script type="text/javascript" src="jquery.js"></script>
<script type="text/javascript" src="jquery.alphanumeric.js"></script>
<script type="text/javascript">
$(document).ready(function(){
	$('#number').numeric();
	$('#money').numeric();

});
</script>
<script language='javascript'>

 function check()
  {
var v1 = document.form1;  
 var objmoney=form1.money
 var objnumber=form1.number
 var number = "1234567890"
 var valmoney=objmoney.value
 var valnumber=objnumber.value
var valOK = true;

 for (i=0; i<valnumber.length & valOK; i++){
valOK = (number.indexOf(valnumber.charAt(i))!= -1)
}
 if (!valOK) {
alert("ใส่เลขห้องเป็นตัวเลขเท่านั้น !!! ")
objnumber.focus()
return false;
}	 
 for (i=0; i<valmoney.length & valOK; i++){
valOK = (number.indexOf(valmoney.charAt(i))!= -1)
}
 if (!valOK) {
alert("ใส่จำนวนเงินเป็นตัวเลขเท่านั้น !!! ")
objmoney.focus()
return false;
}
  
if ( v1.number.value.length==0) {
alert("กรุณาป้อนข้อมูลให้ครบ");
v1.number.focus();
return false;
}else if ( v1.money.value.length==0) {
alert("กรุณาป้อนข้อมูลให้ครบ");
v1.money.focus();
return false;
}	else if ( (v1.total.value - v1.money.value) < 0) {
alert("จำนวนเงินเกิน");
v1.money.focus();
return false;
}else if ( v1.money.value.length < 4) {
alert("จำนวนเงินน้อยเกิน");
v1.money.focus();
return false;
}
return confirm ('ยืนยันข้อมูล');
return true;


}

 
 </script>
<!-- End Save for Web Slices -->
</body>
</html>


เว็บหน้านี้ผมมีโคด๊แบบนี้อยู่ครับ
แสดงความคิดเห็นโดยอ้างถึง ความคิดเห็นนี้
Date : 2012-08-15 19:36:18 By : kingofdaeth
 


 

No. 5



โพสกระทู้ ( 1,521 )
บทความ ( 2 )

สมาชิกที่ใส่เสื้อไทยครีเอท Hall of Fame 2012

สถานะออฟไลน์
Facebook

ประมาณนี้ป่าว
Code (PHP)
<!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 type="text/javascript" src="http://code.jquery.com/jquery.min.js"></script>
<script type="text/javascript">
$(document).ready(function(){
	$("img").click(function(){
		var $Va = $(this).attr("title");
		var $PID = $("#PID").val();
		if ($PID==""){
			$("#PID").val($Va);
		}else {
			$("#PID").val($PID+","+$Va);
		}
	});
});
</script>
</head>
<body>
<p><img width="100" height="150" title="1" />
  <img width="100" height="150" title="2" />
  <img width="100" height="150" title="3" />
  <img width="100" height="150" title="4" />
</p>
<p><input name="PID" id="PID" type="text" /></p>
</body>
</html>

แสดงความคิดเห็นโดยอ้างถึง ความคิดเห็นนี้
Date : 2012-08-15 20:09:53 By : Krungsri
 


 

No. 6



โพสกระทู้ ( 20 )
บทความ ( 0 )



สถานะออฟไลน์


ตอบความคิดเห็นที่ : 5 เขียนโดย : Krungsri เมื่อวันที่ 2012-08-15 20:09:53
รายละเอียดของการตอบ ::
ขอบคุณครับ

แสดงความคิดเห็นโดยอ้างถึง ความคิดเห็นนี้
Date : 2012-08-19 19:33:11 By : kingofdaeth
 

   

ค้นหาข้อมูล


   
 

แสดงความคิดเห็น
Re : ต้องที่จะ คลิกรูปแล้ว รูปส่งค่าไปแสดงใน textbox ในเพจเดียวกัน ส่งค่าเป็นตัวเลข แต่ละรูปมีค่าตัวเลขไม่เหมือนกัน
 
 
รายละเอียด
 
ตัวหนา ตัวเอียง ตัวขีดเส้นใต้ ตัวมีขีดกลาง| ตัวเรืองแสง ตัวมีเงา ตัวอักษรวิ่ง| จัดย่อหน้าอิสระ จัดย่อหน้าชิดซ้าย จัดย่อหน้ากึ่งกลาง จัดย่อหน้าชิดขวา| เส้นขวาง| ขนาดตัวอักษร แบบตัวอักษร
ใส่แฟลช ใส่รูป ใส่ไฮเปอร์ลิ้งค์ ใส่อีเมล์ ใส่ลิ้งค์ FTP| ใส่แถวของตาราง ใส่คอลัมน์ตาราง| ตัวยก ตัวห้อย ตัวพิมพ์ดีด| ใส่โค้ด ใส่การอ้างถึงคำพูด| ใส่ลีสต์
smiley for :lol: smiley for :ken: smiley for :D smiley for :) smiley for ;) smiley for :eek: smiley for :geek: smiley for :roll: smiley for :erm: smiley for :cool: smiley for :blank: smiley for :idea: smiley for :ehh: smiley for :aargh: smiley for :evil:
Insert PHP Code
Insert ASP Code
Insert VB.NET Code Insert C#.NET Code Insert JavaScript Code Insert C#.NET Code
Insert Java Code
Insert Android Code
Insert Objective-C Code
Insert XML Code
Insert SQL Code
Insert Code
เพื่อความเรียบร้อยของข้อความ ควรจัดรูปแบบให้พอดีกับขนาดของหน้าจอ เพื่อง่ายต่อการอ่านและสบายตา และตรวจสอบภาษาไทยให้ถูกต้อง

อัพโหลดแทรกรูปภาพ

Notice

เพื่อความปลอดภัยของเว็บบอร์ด ไม่อนุญาติให้แทรก แท็ก [img]....[/img] โดยการอัพโหลดไฟล์รูปจากที่อื่น เช่นเว็บไซต์ ฟรีอัพโหลดต่าง ๆ
อัพโหลดแทรกรูปภาพ ให้ใช้บริการอัพโหลดไฟล์ของไทยครีเอท และตัดรูปภาพให้พอดีกับสกรีน เพื่อความโหลดเร็วและไฟล์ไม่ถูกลบทิ้ง

   
  เพื่อความปลอดภัยและการตรวจสอบ กระทู้ที่แทรกไฟล์อัพโหลดไฟล์จากที่อื่น อาจจะถูกลบทิ้ง
 
โดย
อีเมล์
บวกค่าให้ถูก
<= ตัวเลขฮินดูอารบิก เช่น 123 (หรือล็อกอินเข้าระบบสมาชิกเพื่อไม่ต้องกรอก)







Exchange: นำเข้าสินค้าจากจีน, Taobao, เฟอร์นิเจอร์, ของพรีเมี่ยม, ร่ม, ปากกา, power bank, แฟลชไดร์ฟ, กระบอกน้ำ

Load balance : Server 00
ThaiCreate.Com Logo
© www.ThaiCreate.Com. 2003-2024 All Rights Reserved.
ไทยครีเอทบริการ จัดทำดูแลแก้ไข Web Application ทุกรูปแบบ (PHP, .Net Application, VB.Net, C#)
[Conditions Privacy Statement] ติดต่อโฆษณา 081-987-6107 อัตราราคา คลิกที่นี่