Hello and welcome to our community! Is this your first visit?
Enjoy an ad free experience by logging in. Not a member yet? Register.
Page 2 of 2 FirstFirst 12
Results 16 to 17 of 17
  1. #16
    Senior Coder
    Join Date
    Apr 2011
    London, England
    Thanked 354 Times in 353 Posts
    <br/>Email Address: <br /> &nbsp; <input type="text" id="email"> <br />
    id= should be name= to make your code fragment work. Personally I tend to use both id and name and give them the same value (except for grouped elements - radio buttons, etc.. - because ids must be unique).
    Last edited by AndrewGSW; 12-13-2012 at 07:45 PM.
    "I'm here to save your life. But if I'm going to do that, I'll need total uninanonynymity." Me Myself & Irene.
    Validate your HTML and CSS

  2. #17
    Supreme Master coder! Old Pedant's Avatar
    Join Date
    Feb 2009
    Thanked 4,947 Times in 4,908 Posts
    Yep, Andrew saw it.

    Too much copy, not enough editing on my part. Should have been.
                <br/>Email Address: <br /> &nbsp; <input type="text" name="email"> <br />
    But I disagree with Andrew: I *NEVER* give an ID to form fields unless there is some very good reason. Granted, 99% of everything I do with <form>s has to interact with server-side code, and fields without names are useless for that purpose. But even so, you don't need an ID to reference any <form> field, so why bother?

    Almost the only exception is when I use <label for="someID"> in which case of course there must be a matchind ID. But even then, I tend to use <label> with the for= property.
    Be yourself. No one else is as qualified.

Page 2 of 2 FirstFirst 12

Tags for this Thread

Posting Permissions

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