GORAGOD.com
freelance, web developer, web designer, hosting, domain name
Home
Host & Domain
Portfolio
ช่วยที่ครับ ผมนั่งงมมานานแล้วเกี่ยวกับ popup
Home
Forum
ช่วยที่ครับ ผมนั่งงมมานานแล้วเกี่ยวกับ popup
weaned
พอดีผมทำไปแล้วขึ้น popup พอคลิกตกลง มันขึ้นข้อมูลในหน้า popup มันไม่ขึ้นในหน้าแรกที่ให้คลิกเข้ามา ทำอย่างไรข้อมูลมันจะไปเรียงกันในหน้าแรกครับ
montree_33@hotmail.com
ตอนนี้ผมทำได้แต่ว่าเปิด popup ใส่ได้เบอร์แรกอย่างเดียว ถ้าใส่เบอร์ที่สองไป เบอร์แรกจะหาย
popup.php
<!doctype html>
<html>
<head>
<meta charset="utf-8">
<title>
Untitled Document
</title>
</head>
<body>
<form id="form1" name="form1" method="post" action="">
<input type="text" name="data1_popup" id="data1_popup" />
<input type="submit" name="button" id="button" value="Submit" />
</form>
<script type="text/javascript" src="http://code.jquery.com/jquery-latest.min.js">
</script>
<script type="text/javascript">
$(function(){
$("#form1").submit(function(){
var opener_obj=$("#data1",window.opener.document);
opener_obj.val($("#data1_popup").val());
window.close();
return false;
});
// jQuery code
});
</script>
</body>
</html>
index.php
<!doctype html>
<html>
<head>
<meta charset="utf-8">
<title>
Untitled Document
</title>
</head>
<script type="text/javascript" src="http://code.jquery.com/jquery-latest.min.js">
</script>
<script type="text/javascript">
function popup(url,name,windowWidth,windowHeight){
myleft=(screen.width)?(screen.width-windowWidth)/2:100;
mytop=(screen.height)?(screen.height-windowHeight)/2:100;
properties = "width="+windowWidth+",height="+windowHeight;
properties +=",scrollbars=yes, top="+mytop+",left="+myleft;
window.open(url,name,properties);
}
</script>
<body>
<form id="form1" name="form1" method="post" action="">
<input type="text" name="data1" id="data1" />
</form>
<a href="javascript:popup('popup.php','',400,100)" >
เปิด popup
</a>
</body>
</html>
ช่วยทีครับ อยากให้มันเรียงกันแล้วมีเครื่องหมยคอมม่าคั่นด้วยครับ
goragod
แค่กรอกเบอร์โทรศัพท์อย่างเดียวใช้คำสั่ง prompt() ดีมั้ยครับ
http://www.w3schools.com/jsref/met_win_prompt.asp
ส่วนจะแสดงข้อมูลลงในตารางถัดจากของเดิม มีหลายคำสั่งครับ เช่น appendChild
จริงๆแล้วถ้าเป็น
ตาราง
ก็ต้องใช้คำสั่งของตารางโดยเฉพาะครับ ตัวอย่างหาได้บนเว็บครับ
ความคิดเห็น
รายละเอียด
ไฟล์อัปโหลด ชนิด jpg, jpeg ขนาดไฟล์ไม่เกิน 1024
^
popup.php
<!doctype html>
<html>
<head>
<meta charset="utf-8">
<title>Untitled Document</title>
</head>
<body>
<form id="form1" name="form1" method="post" action="">
<input type="text" name="data1_popup" id="data1_popup" />
<input type="submit" name="button" id="button" value="Submit" />
</form>
<script type="text/javascript" src="http://code.jquery.com/jquery-latest.min.js"></script>
<script type="text/javascript">
$(function(){
$("#form1").submit(function(){
var opener_obj=$("#data1",window.opener.document);
opener_obj.val($("#data1_popup").val());
window.close();
return false;
});
// jQuery code
});
</script>
</body>
</html>
index.php
<!doctype html>
<html>
<head>
<meta charset="utf-8">
<title>Untitled Document</title>
</head>
<script type="text/javascript" src="http://code.jquery.com/jquery-latest.min.js"></script>
<script type="text/javascript">
function popup(url,name,windowWidth,windowHeight){
myleft=(screen.width)?(screen.width-windowWidth)/2:100;
mytop=(screen.height)?(screen.height-windowHeight)/2:100;
properties = "width="+windowWidth+",height="+windowHeight;
properties +=",scrollbars=yes, top="+mytop+",left="+myleft;
window.open(url,name,properties);
}
</script>
<body>
<form id="form1" name="form1" method="post" action="">
<input type="text" name="data1" id="data1" />
</form>
<a href="javascript:popup('popup.php','',400,100)" >เปิด popup </a>
</body>
</html>
ช่วยทีครับ อยากให้มันเรียงกันแล้วมีเครื่องหมยคอมม่าคั่นด้วยครับ
ส่วนจะแสดงข้อมูลลงในตารางถัดจากของเดิม มีหลายคำสั่งครับ เช่น appendChild
จริงๆแล้วถ้าเป็นตาราง ก็ต้องใช้คำสั่งของตารางโดยเฉพาะครับ ตัวอย่างหาได้บนเว็บครับ