看板 Web_Design 關於我們 聯絡資訊
各位大大好... <(_ _)> 在 Client 端想要做一個行為, 利用 <input type="file ... > 選檔案後就自動 submit。 在網路上查到的資料都這麼說 <input type="file" onchange="this.form.submit();" ..... > 還有很多變型,像是用 jQuery 之類的... 大致上都一樣,就是用 onchange,但我試了各種方式, 感覺我在選擇檔案的時候,那個 input 根本就沒有 changed, 別說 submit() 了,我放 alert() 都沒反應... 想請問各位大大,是不是我誤解了什麼... QwQ -- Would you be my heroine?  https://goo.gl/KbSK7y -- ※ 發信站: 批踢踢實業坊(ptt.cc), 來自: 114.45.204.150 ※ 文章網址: https://www.ptt.cc/bbs/Web_Design/M.1470521455.A.071.html
archon: 自問自答: 因為我底下的 submit button 的 name 命名問題 08/07 13:53
archon: <input type="submit" name="submit" id="Upload" /> 08/07 13:53
archon: name 不要取為 submit 就好了 QwQ 08/07 13:54
kyleJ: 推自己解答 另外js要很小心撞名的問題 08/07 19:12
kyleJ: 常常不小心就命名到不能使用的名字orz 08/07 19:13