GORAGOD.com
freelance, web developer, web designer, hosting, domain name
Home
Host & Domain
Portfolio
การกด Enter แล้วเลื่อนบรรทัดลงมา php
Home
Forum
การกด Enter แล้วเลื่อนบรรทัดลงมา php
yoojuy
การกด Enter แล้วเลื่อนบรรทัดลงมา php
ไม่ทราบว่าทำกันอย่างไรครับ ของผมมีอยู่ 1 ตัวสามารถทำได้กับ IE แต่ Firefox และ Chome ไม่ทำงานครับ
เลยอยากเปลี่ยนครับ
goragod
หมายถึงทำที่ไหนครับ ไม่ค่อยเข้าใจคำถาม....
yoojuy
ทำในฟอร์ม PHP ครับ แบบว่ามี Text box 2 ตัว พอกด Enter ตัวที่ 1 Cursor ก็จะเลื่อนมา อยู่ Text Box ตัวที่ 2
nukcode
ภ้าไม่มีคำตอบที่ 2 จะไม่รู้เลยว่าคำถามคืออะไร
goragod
http://www.goragod.com/...0....html
yoojuy
ขอบคุณ คำตอบที่ 3 ที่มาช่วยดูครับ หุหุ
ขอบคุณอาจารย์มากครับ จากตัวอย่างของอาจารย์ ได้แล้วครับ ทุก Browser
<script type="text/javascript">
function nextbox(e, id) {
var keycode = e.which || e.keyCode;
if (keycode == 13) {
document.getElementById(id).focus();
return false;
}
}
</script>
<form method="post" action="test.php">
<input type="text" id="no1" onkeydown="return nextbox(event, 'no2');" />
<input type="text" id="no2" onkeydown="return nextbox(event, 'no3');" />
<input type="text" id="no3" />
<input type="submit" />
</form
ความคิดเห็น
รายละเอียด
ไฟล์อัปโหลด ชนิด jpg, jpeg ขนาดไฟล์ไม่เกิน 1024
^
ขอบคุณอาจารย์มากครับ จากตัวอย่างของอาจารย์ ได้แล้วครับ ทุก Browser
<script type="text/javascript">
function nextbox(e, id) {
var keycode = e.which || e.keyCode;
if (keycode == 13) {
document.getElementById(id).focus();
return false;
}
}
</script>
<form method="post" action="test.php">
<input type="text" id="no1" onkeydown="return nextbox(event, 'no2');" />
<input type="text" id="no2" onkeydown="return nextbox(event, 'no3');" />
<input type="text" id="no3" />
<input type="submit" />
</form