So I have
<form id="formA">
<input id="uuid">
</form>
<form id="formB">
<input id="uuid">
</form>
is this ok to have 2 field names on different forms? I'm thinking access via javascript.
So I have
<form id="formA">
<input id="uuid">
</form>
<form id="formB">
<input id="uuid">
</form>
is this ok to have 2 field names on different forms? I'm thinking access via javascript.
The same name? Yes. They can be in the same form for that matter (this is essential for radio button groups!)
Your example, however, has two elements with the same id which is not OK. An id must be unique within a document.
It's okay to have two names that are the same, but in your example you have two ids that are the same, which is not valid.
No, identical id
s in a document are invalid. You can have multiple name
s in different forms, though.
David is correct from a "good programming" stand-point. By definition an "id" should be unique. However, if you HAD to have this, you could access those input nodes, you would just need to access their parent, first.