[zz]javascript: Form onsubmit Event

http://ww.w3schools.com/jsref/event_form_onsubmit.asp

 

<html>
<head>
<script type="text/javascript">
function greeting()
{
alert("Welcome " + document.forms["frm1"]["fname"].value + "!")
}
</script>
</head>
<body>

 

What is your name?<br />
<form name="frm1" action="submit.htm" onsubmit="greeting()">
<input type="text" name="fname" />
<input type="submit" value="Submit" />
</form>

</body>
</html>

posted @ 2010-06-30 20:57  bettermanlu  阅读(244)  评论(0编辑  收藏  举报