I am creating and filling a text-boxes from an arraylist using struts iterator. Now all the generated text-boxes have same “ID”, even if didn’t give id for each element. I want either the ID’s to be unique or no ID’s at all.
<s:iterator value="specificationList" status="status">
<s:textfield name="specification" />
</s:iterator>
Expected output
<input type="text" value="Test Spec1" name="specification">
<input type="text" value="Test Spec2" name="specification">
<input type="text" value="Test Spec3" name="specification">
or
<input type="text" id="specification1" value="Test Spec1" name="specification">
<input type="text" id="specification2" value="Test Spec2" name="specification">
<input type="text" id="specification3" value="Test Spec3" name="specification">
Actual Output
<input type="text" id="specification" value="Test Spec1" name="specification">
<input type="text" id="specification" value="Test Spec2" name="specification">
<input type="text" id="specification" value="Test Spec3" name="specification">
I also tried s:form themes simple and css_xhtml all these creating id’s for the text-boxes
Any help will be appreciated.
Give it an id.
(Untested, but close; off the top of my head.)