Cloud Cloud Cloud Cloud

The name Attribute

The Current State of HTML5 Forms

Let Wufoo do the hard work. Sign up for a free account and start making forms the easy way.

Live Demo

name=foo

name=bar

  1. 1st Choice
  2. 2nd Choice
  3. 3rd Choice

name=”submit”

 


Firefox

Safari

Safari

Chrome

Opera

IE

Android

The Low Down

The name attribute defines the name of the form control, and is submitted along with the form control’s value when the form is submitted. It is the name part of the name/value pair associated with an element for the purposes of form submission.

  • The value of the name attribute can’t be an empty string, and should be unique, except in the case of radio and checkbox.
  • For radio, use the same name for all of the radio buttons in each group of radio buttons: only one radio button in a group of same named radio buttons can be selected at a time.
  • Though by no means required, you can give a group of checkboxes the same name, though each should have a different value.
  • Valid for all input types, and all other form controls. In addition to <button><textarea><select><form> and <input>, it is also valid on <iframe><object><map><param>, and <meta> tags.
  • When it comes to maps, the name attribute is how the <map> can be referenced.
  • The name attribute is required on <param>.
  • The name attribute on links and images is now obsolete. Use id instead.
  • The name attribute was also valid on applets and frames, which are now obsolete.
Cloud Cloud Cloud Cloud

Let Wufoo do the hard work.

Sign up for a free account and start making forms the easy way.