I know you can use name arrays for multiple form inputs (e.g. <input type="text" name="username[]">
, but can this also be used for entire fieldsets? How would this be manipulated with the PHP $_POST global?
Here's what I am trying to do:
<fieldset name="player[]">
<input type="text" name="username">
<input type="number" name="points">
</fieldset>
<fieldset name="player[]">
<input type="text" name="username">
<input type="number" name="points">
</fieldset>
The reason why I am trying to do this is because I am building a form that allows the user to dynamically add/subtract "player" fieldsets. If you have a better solution than what I was asking for, please feel free to provide an alternative.