...

View Full Version : What's the purpose of specifying the name of a form?



Ahlahn
12-21-2010, 10:12 PM
What's the point of having the name in ...

<form id="form" name="form" method="post" action="mailto:example@email.com">

The method identifies what the form will be used for (to collect data), and the action specifies what happens with the data.

So what's the deal with the name?

Thanks!

jmace
12-21-2010, 11:40 PM
For DOM referencing in languages like JavaScript.
As in:

<html>
<head>
<script type="text/javascript">
function formname(){
alert(document.myform)
}
</script>
</head>
<body onload="formname()">
<form name="myform"></form>
</body>
</html>



EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum