這很奇怪,因爲我在IE中只有1個錯誤:'sTime是未定義的'。 sTime是表單中許多輸入元素之一的ID。在Chrome和FF中一切正常。這裏有一個鏈接代碼:無法訪問IE中的表單元素,因爲它'未定義'。在FF和Chrome中可以正常工作
http://la.truxmap.com/sched.html
和HTML表單:
<form id="addNewTruck" class='updateschedule' action="javascript:sub(sTime.value, eTime.value, lat.value, lng.value, street.value);">
<b style="color:green;">Opening at: </b>
<input id="sTime" name="sTime" title="Opening time" value="Click to set opening time" class="datetimepicker"/>
<b style="color:red;">Closing at: </b>
<input id="eTime" name= "eTime" title="Closing time" value="Click to set closing time" class="datetimepicker"/>
<b style="color:blue;">Address: </b>
<input type='text' name='street' id='street' class='text street' autocomplete='off'/>
<input id='submit' class='submit' style="cursor: pointer; cursor: hand;" type="submit" value='Add new stop'/>
<div id='suggests' class='auto_complete' style='display:none'></div>
<input type='hidden' name='lat' id='lat'/>
<input type='hidden' name='lng' id='lng'/>
<input type='hidden' value='CA' name='state' id='state' class='text state' />
感謝您的幫助!
使用的onsubmit而不是行動似乎允許IE訪問輸入元素。現在即不喜歡我用來格式化日期字符串的正則表達式...任何想法可能會導致這種情況? – 2010-07-19 10:23:28
@culov nope,對不起。也許值得一個單獨的問題。 – Unicron 2010-07-19 12:45:46