In order to validate a form like:
<input type="text" name="trueExplain" />
<input type="text" name="true1" />
<input type="text" name="true2" />
<input type="text" name="true3" />
<input type="text" name="true4" />
<input type="text" name="true5" />
in order to validate fields before submit, I want to add an id for each input element:
<input type="text" name="true1" />
becomes:
<input id="true1" type="text" name="true1" />
Then, for each input element, I want to add a label:
<input type="text" name="trueExplain" />
<input type="text" name="true1" />
etc
becomes:
<label for="trueExplain"></label>
<input id="trueExplain" type="text" name="trueExplain" />
<label for="true1"></label>
<input id="true1" type="text" name="true1" />
etc
I need some guidance both in design and implementation with jQuery.