It doesn't matter if they are the same or not, but you normally need them both. The name attribute identifies the input for the form processing script, which the id associates the input with an accompanying <label> element, which has a "for=" attribute.

The for="blah" / id="blah" associates the label with the input. That's handy for people using a screen reader (who can't "see" the relationships) and also means you can click on the Label to activate the input.

Of course, the id on the input can also be used as a hook for JS and CSS.

If you are going to use the same value for botha name and an id then you need to make sure they are on the same element. If one is on one tag and the other is on a different tag then Internet Explorer will become more confused than it normally is.

If you are going to use the same value for botha name and an id then you need to make sure they are on the same element. If one is on one tag and the other is on a different tag then Internet Explorer will become more confused than it normally is.

Good to know. I'm adding the id= to existing name= on form elements, and they do match each other only, and not other elements.