การกด Enter แล้วเลื่อนบรรทัดลงมา php
ไม่ทราบว่าทำกันอย่างไรครับ ของผมมีอยู่ 1 ตัวสามารถทำได้กับ IE แต่ Firefox และ Chome ไม่ทำงานครับ
เลยอยากเปลี่ยนครับ
ไม่ทราบว่าทำกันอย่างไรครับ ของผมมีอยู่ 1 ตัวสามารถทำได้กับ IE แต่ Firefox และ Chome ไม่ทำงานครับ
เลยอยากเปลี่ยนครับ
หมายถึงทำที่ไหนครับ ไม่ค่อยเข้าใจคำถาม....
ทำในฟอร์ม PHP ครับ แบบว่ามี Text box 2 ตัว พอกด Enter ตัวที่ 1 Cursor ก็จะเลื่อนมา อยู่ Text Box ตัวที่ 2
ภ้าไม่มีคำตอบที่ 2 จะไม่รู้เลยว่าคำถามคืออะไร
ขอบคุณ คำตอบที่ 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
ขอบคุณอาจารย์มากครับ จากตัวอย่างของอาจารย์ ได้แล้วครับ ทุก 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