onsubmit 事件:在表单中的确认按钮被点击时发生。
<form name="testform" action="jsref_onsubmit.asp" onsubmit="alert('Hello ' + testform.fname.value +'!')"> What is your name?<br /> <input type="text" name="fname" /> <input type="submit" value="Submit" /> </form> /* ASP是动态服务器页面(Active Server Pages)的英文缩写,后来也称为经典ASP, 是微软公司开发的代替CGI脚本程序的一种应用,也是微软公司的第一个服务器侧的脚本引擎, 可以动态产生Web页面。ASP能够与Web数据库以及其它程序进行交互, 是一种简单、方便的编程工具。ASP的网页文件的格式是.asp, 曾用于各类动态网站中。2002年1月微软发布ASP.NET,用于取代ASP。 */
来源:http://www.w3school.com.cn/jsref/event_onsubmit.asp?javascript
——————————————————————————html
name 属性规定表单的名称。java
form 元素的 name 属性提供了一种在脚本中引用表单的方法。数据库
<html> <head> <script type="text/javascript"> function formSubmit() { document.forms["myForm"].submit(); } </script> </head> <body> <form name="myForm" action="/example/html/form_action.asp" method="get"> First name: <input type="text" name="fname" /><br /> Last name: <input type="text" name="lname" /><br /> <input type="button" onclick="formSubmit()" value="Send form data!" /> </form> <p>请单击确认按钮,输入会发送到服务器上名为 "form_action.asp" 的页面。</p> </body> </html>
来源: http://www.w3school.com.cn/tags/att_form_name.asp编程