Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 2 of 2
  1. #1
    New Coder
    Join Date
    Sep 2010
    Location
    The Twilight Zone
    Posts
    86
    Thanks
    17
    Thanked 2 Times in 2 Posts

    What's the purpose of specifying the name of a form?

    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!

  2. #2
    New Coder
    Join Date
    Oct 2010
    Posts
    29
    Thanks
    0
    Thanked 2 Times in 2 Posts
    For DOM referencing in languages like JavaScript.
    As in:
    Code:
        <html>
    <head>
        <script type="text/javascript">
            function formname(){
                alert(document.myform)
            }
        </script>
    </head>
    <body onload="formname()">
        <form name="myform"></form>
    </body>
        </html>


 

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •