→ opoepev:真的很難懂~不過~應該是你給值沒給對吧! 用個簡略code來看 08/11 16:27
////////
我再說明一下好了
沒加入<form>時, text每個都可以藉由body裡的js把值塞到text的value
可是我加入<form>以後 變得每個text都沒有值了(感覺上是js不能執行了)
並不是指把text的值傳到xxx.php 可能標題會有點誤會
※ 編輯: airtsubasa 來自: 218.164.147.32 (08/11 17:21)
→ rocairforce:submit之後直接action了吧 08/11 20:09
////////
我貼上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)
→ opoepev:你js用document.名字?~加入form後變 document.form1.名字~ 08/13 11:55
→ airtsubasa:可以了,謝謝^^ 不過換成xxx.php接收不到值耶... 08/13 19:37
→ airtsubasa:一樣是用 $tshow1=$_POST["Tshow1"]; 這樣子嗎? 08/13 19:37
→ opoepev:如果有post過去php才能這樣寫~應該可以~先確認值吧~ 08/16 15:47
→ opoepev:我講太多了~其實~你的input text 少了一個 name的屬性~ 08/16 15:49
→ opoepev:form 取得的方式是透過name這個屬性... 08/16 15:49