In HTML forms, id
and name
are not the used for the same things. XML requires that each id
is unique. This is not the case for name
. Consider the following form:
<form ...>
<input type="radio" value="1" name="option" id="option1" />
<label for="option1">Option 1</label>
<input type="radio" value="2" name="option" id="option2" />
<label for="option1">Option 2</label>
<input type="radio" value="3" name="option" id="option3" />
<label for="option1">Option 3</label>
</form>
The name
of the three input
tags must be the same to achieve the desired selection behavior (one out of the three). However, the id
field needs to be unique (by specification and for the label
tags).
Lift obviously aims to generate HTML that can support such a use case and hence has to generate id
and name
separately in this case. What you see is probably just a result of generalization (nothing requires name
and id
to be equal after all).