I've got a loop which outputs a number if text boxes depending on user selection. Everything works as it should but how can I get it to name each textbox it creates differently? Here's a snippet from the section of the loop i'm talking about:
Obviously at the moment every textbox created will be called "txt1". But i want each subsequent one to have a different name from the last, ie txt2 txt3 etc. How would I go about achieving this?
Code:
while ($i < 10) {
print '<tr><td><input type="text" name="txt1" /></td></tr>';
Obviously at the moment every textbox created will be called "txt1". But i want each subsequent one to have a different name from the last, ie txt2 txt3 etc. How would I go about achieving this?