 |
ต้องการ ค่าจาก form ที่ถูกต้องค่ะ มีคนตอบแล้ว แต่ก็ยังไม่ได้ค่ะ มีโค๊ด ดังนี้ค่ะ |
|
 |
|
|
 |
 |
|
อันนี้เท่าที่ผมคาดนะ ที่ค่ามันไม่ออก ก็เพราะว่า popup หน้าที่คุณจะส่งค่าอะ
มันยังไม่มีค่าส่งไปไง มันเหมือนกับคุณเรียกหน้านั้นขึ้นมาเฉยๆ ซึ่งมันไม่มีค่าอะไรอยู่แล้ว ซึ่งมันเลยออกมาเป็น 0
เออ... คือจะให้ทั้ง popup และ เปลี่ยนหน้าที่ส่งค่าเลยรึป่าวคับ คือผมทำแบบ get อะได้รึป่าว
ทำใน html อะคับใช่ php ครอบได้รึป่าว
Code (PHP)
<html>
<head>
<script>
function test(){
var n1=document.getElementById('num1').value;
var n2=document.getElementById('num2').value;
var data = "m1="+n1+"&m2="+n2;
window.open('testDB.php?'+data,'','width=400,height=400,left=300,top=100,screenX=0,screenY=100');
location.href='testDB.php?'+data;
}
</script>
</head>
<body>
<table width=100% cellspacing=1 cellpadding=3 bgcolor=B0C4DE align=left >
<tr bgcolor=f5f5f5>
<td><input type=text name=num1 style=" font-size: 25pt; color:9932cc;width:100%; hieght:220pt" value=$gtotal></td>
<td><input type=text name=num2 style=" font-size: 25pt; color:9932cc;width:100%; hieght:220pt" ></td>
<td colspan=2>
<input type=button value=Submit onclick='test();'>
</td></tr></table>
</body>
</html>
|
 |
 |
 |
 |
Date :
2010-02-04 11:35:07 |
By :
Po[k]@za |
|
 |
 |
 |
 |
|
|
 |
 |
|
 |
 |
 |
|
|
 |
 |
|
เอาแค่หน้าเดียว คือหน้าที่ เป็น popup น่ะค่ะ
ขอบคุณนะคะ
|
 |
 |
 |
 |
Date :
2010-02-04 11:52:20 |
By :
น้องเดือน |
|
 |
 |
 |
 |
|
|
 |
 |
|
 |
 |
 |
|
|
 |
 |
|
ไม่ไปไหนเลยค่ะ submit ไม่ไปน่ะค่ะ
<?
include("config.php");
echo"<html>
<head>
<script>
function test(){
var n1=document.getElementById('num1').value;
var n2=document.getElementById('num2').value;
var data = m1=+n1+&m2=+n2;
window.open('changem.php?'+data,'','width=400,height=400,left=300,top=100,screenX=0,screenY=100');
location.href='changem.php?'+data;
}
</script>
</head>
<body>
<table width=100% cellspacing=1 cellpadding=3 bgcolor=B0C4DE align=left >
<tr bgcolor=f5f5f5>
<td><input type=text name=num1 style=font-size: 25pt; color:9932cc;width:100%; hieght:220pt value=500></td>
<td><input type=text name=num2 style=font-size: 25pt; color:9932cc;width:100%; hieght:220pt ></td>
<td colspan=2>
<input type=submit value=Submit onclick=\"test();\">
</td></tr></table>
</body>
</html>";
?>
|
 |
 |
 |
 |
Date :
2010-02-04 14:13:02 |
By :
น้องเดือน |
|
 |
 |
 |
 |
|
|
 |
 |
|
 |
 |
 |
|
|
 |
 |
|
ส่งให้ popup แบบ GET ไม่ได่หรอคะ
|
 |
 |
 |
 |
Date :
2010-02-04 14:24:54 |
By :
ultrasiam |
|
 |
 |
 |
 |
|
|
 |
 |
|
 |
 |
 |
|
|
 |
 |
|
แบบ GET ก็ยังไม่ได้ค่ะ งง เลยค่ะ
มีตัวอย่าง ส่งให้่หน่อยค่ะ จะได้ลอง ดัดแปลงดูค่ะ
ขอบคุณ นะคะ
|
 |
 |
 |
 |
Date :
2010-02-04 14:34:14 |
By :
duan |
|
 |
 |
 |
 |
|
|
 |
 |
|
 |
 |
 |
|
|
 |
 |
|
ประมาณนี้อะค่ะ
Code (PHP)
<form id="form1" name="form1" method="post" action="">
<input name="num1" id="num1" type="text" id="num1" />
<br />
<input name="num2" id="num2" type="text" id="num2" />
<br />
<input type="button" name="Button" value="Button" onclick="open_popup()"/>
</form>
<script>
function open_popup(){
var num1=document.getElementById("num1").value
var num2=document.getElementById("num2").value
window.open("changem.php?num1="+num1+"&num2="+num2+"","changem","width=400,height=400,left=300,top=100,screenX=0,screenY=100").focus();
}
</script>
|
 |
 |
 |
 |
Date :
2010-02-04 14:51:23 |
By :
ultrasiam |
|
 |
 |
 |
 |
|
|
 |
 |
|
 |
 |
 |
|
|
 |
 |
|
เปลี่ยนจากจาวาเป็น php ได้ไหมครับ ง่ายกว่าแยะ
|
 |
 |
 |
 |
Date :
2010-02-04 15:04:39 |
By :
Dragons_first |
|
 |
 |
 |
 |
|
|
 |
 |
|
 |
 |
 |
|
|
 |
 |
|
โอ้โห เฮะ ..... แจ๋วจริง ๆ เลยค่ะ ได้ทันตาเห็นเลย คุณ อุลตร้าสยาม
ขอบคุณ มาก ค่ะ
ร้องเพลง ได้ละ ครานี้ เิอิ๊ง เอย ......
|
 |
 |
 |
 |
Date :
2010-02-04 17:01:16 |
By :
น้องเดือน |
|
 |
 |
 |
 |
|
|
 |
 |
|
 |
 |
|
|