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 3 of 3

Thread: Form input name

  1. #1
    New to the CF scene
    Join Date
    Mar 2012
    Posts
    4
    Thanks
    4
    Thanked 0 Times in 0 Posts

    Form input name

    Hi
    Is it possible to have a form input without the name tag e.g:
    Code:
    <form method="POST" action="form.aspx"
    <input type="text" id="username">
    <input type="password" id="passwd">
    </form>
    Regards

  2. #2
    Regular Coder stevenmw's Avatar
    Join Date
    Jun 2007
    Location
    OK
    Posts
    497
    Thanks
    27
    Thanked 31 Times in 31 Posts
    It's important to give any input field a name. That way you can control it, use it, call it, etc. Without a name how could you use the field?

    Code:
    <input type="text" name="test">
    From here on out i know exactly what name to call when I want to refer to the above field.

  3. #3
    Supreme Master coder! abduraooft's Avatar
    Join Date
    Mar 2007
    Location
    N/A
    Posts
    15,060
    Thanks
    165
    Thanked 2,250 Times in 2,237 Posts
    name is called as an attribute, not a tag.
    It's "valid" to have an input without name, however the values won't be available at the server side after submit, unless you use some AJAX script.


 

Posting Permissions

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