[JS 學習] javascript 之 onsubmit 用法

javascript的onsubmit()方法,一般用在按下submit提交按鈕後,對輸入框的內容做檢查

如果不想讓form,提交至另一頁面,在function結尾,加上return false就可以了

此篇就簡單介紹onsubmit用法,當輸入的值,不對的時候,就出現alert警告

避免被瀏覽器解析,請下載 example001.zip 這個範例檔

drive.googleonedrive.live【下載教學】

ex001.php 要跑 php 你可能要裝一下 wampserver → a5_架站軟體

ex001.htm及ex001.php代碼及執行結果






對上述圖文教學,還不太明白的話,請至下方連結,查看 youtube 視頻解說

視頻解說之第一部分 https://www.youtube.com/watch?v=oHUzFmfWq7s

謝謝大家,抽空觀看,files備份檔名 javascriptguides001

沒有留言:

發佈留言

由於一直被灌水, 因此您發表留言之後, 需要等待博客主的審核, 才會公開您的留言, 所以請不要重複的留言
Hello my friend, I have no money, My blog is super chill, Please do not screw me up in the replies at the bottom of the article, thanks a lot