Let Wufoo do the hard work. Sign up for a free account and start making forms the easy way.
Live Demo
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 ofradio
andcheckbox
. - 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. Useid
instead. - The
name
attribute was also valid on applets and frames, which are now obsolete.