[問題] form 傳遞變數
再還沒加上 form action="xxx.php" method="post" 這部份時,整個網頁都還可以執行
先說明一下我的程式架構
<head>
大量js
</head>
<body>
一堆text
一些js,每隔幾秒去call <head>裡面的js,然後去改變text的值
</body>
接著我把form action加在...如以下
1.
<body>
<form action="xxx.php" method="post">
一堆text
<input type="submit" value="enter">
</form>
一些js
</body>
2.
<body>
<form action="xxx.php" method="post">
一堆text
一些js
<input type="submit" value="enter">
</form>
</body>
這兩種位置,text就變成不能拿到值,請問這個問題要怎麼解決?
是form action放的位置不對嗎?
不知道我描述的清不清楚....
--
※ 發信站: 批踢踢實業坊(ptt.cc)
◆ From: 203.64.169.122
→
08/11 16:27, , 1F
08/11 16:27, 1F
////////
我再說明一下好了
沒加入<form>時, text每個都可以藉由body裡的js把值塞到text的value
可是我加入<form>以後 變得每個text都沒有值了(感覺上是js不能執行了)
並不是指把text的值傳到xxx.php 可能標題會有點誤會
※ 編輯: airtsubasa 來自: 218.164.147.32 (08/11 17:21)
→
08/11 20:09, , 2F
08/11 20:09, 2F
////////
我貼上body部份的程式
曳引車車牌:
<input type="text" id="Tshow1" readonly="readonly"><br>
貨櫃架車牌:
<input type="text" id="Tshow2" readonly="readonly"><br>
貨櫃箱編號:
<input type="text" id="Cshow" readonly="readonly"><br>
自然人證號:
<input type="text" id="Ishow1" readonly="readonly"><br>
自然人姓名:
<input type="text" id="Ishow2" readonly="readonly"><br>
<input type="text" id="year" size="3" readonly="readonly">
<input type="text" id="month" size="1" readonly="readonly">
<input type="text" id="date" size="1" readonly="readonly">
<input type="text" id="hour" size="1" readonly="readonly">
<input type="text" id="minute" size="1" readonly="readonly">
<input type="text" id="second" size="1" readonly="readonly">
<!--讀取車牌開始-->
<script language="JavaScript">
rc=autoOpenReader(DemoWeb);
if ( rc != 0 ) {
alert("無法連線讀卡機,請安裝讀卡機及驅動程式!");
history.go(-1);
}
tid=window.setInterval("getRfid()", 1000);
</script>
<!--讀取車牌開始-->
<!-->
<!--讀取貨櫃開始-->
<script language="JavaScript">
sess_str = loginto(reader_ip, username, password);
if (sess_str.length == 0) {
alert("登入CSL461讀取器錯誤!");
history.go(-1);
}
ctid=window.setInterval("readtags()", 1000);
</script>
<!--讀取貨櫃結束-->
<!-->
<!--讀取自然人開始-->
<script LANGUAGE="JavaScript">
window.clearInterval(itid);
itid=window.setInterval("readCard()",1000);
</script>
<!--讀取自然人結束-->
<!-->
<!--與得目前時間開始-->
<script LANGUAGE="JavaScript">
dateid=window.setInterval("DateInTextbox()", 1000);
</script>
<!--取得目前時間結束-->
//////////////////////////////////////////////////////
在還沒加入
<form action="xxx.php" method="post">
曳引車車牌:
.
.
.
<input type="text" id="second" size="1" readonly="readonly">
<input type="submit" value="enter">
</form>
是可以執行的,各欄位也能從外部機器讀取到值
但是加了上面的form之後,就變成無法取得值
連最沒問題的時間欄位,也不會動了...
頭大阿...
※ 編輯: airtsubasa 來自: 203.64.169.122 (08/13 11:54)
→
08/13 11:55, , 3F
08/13 11:55, 3F
→
08/13 19:37, , 4F
08/13 19:37, 4F
→
08/13 19:37, , 5F
08/13 19:37, 5F
→
08/16 15:47, , 6F
08/16 15:47, 6F
→
08/16 15:49, , 7F
08/16 15:49, 7F
→
08/16 15:49, , 8F
08/16 15:49, 8F
Web_Design 近期熱門文章
PTT數位生活區 即時熱門文章