onsubmit
- <html>
- <head>
- <script type="text/javascript">
- function confirmInput()
- {
- fname=document.forms[0].fname.value
- alert("您好 " + fname + "!您会被重定向到 www.jishuchi.com")
- }
- </script>
- </head>
- <body>
- <form onsubmit="confirmInput()" action="http://www.jishuchi.com/">
- 请输入您的名字:<input id="fname" type="text" size="20">
- <input type="submit">
- </form>
- </body>
- </html>