I have the following code...
<h3>Guests</h3>
<form class="form-inline">
<fieldset>
<label class="control-label" for="input01">First Name:</label>
<input type="text" class="input-small" id="input01">
<label class="control-label" for="input01"> Middle Name:</label>
<input type="text" class="input-small" id="input01">
<label class="control-label" for="input01"> Last Name:</label>
<input type="text" class="input-small" id="input01">
<label class="control-label" for="input01"> Birthday:</label>
<input type="text" class="input-small" id="input01">>
</fieldset>
</form>
I would like to be able to add a button that says "Add more", and let that add a new row of elements, eventually saving the form to a database. If I add a button that adds a row (this needs to add a record to the database. for records that are changed, I want to update the record in the database).
So the question, multi-parted is:
- When they click on the "add more" button, I assume this is the best time to add a record to the database. And then when I save the form, I loop through and update all the records in the form. Or are there other ideas?
- The main point: is there an example somewhere that someone can suggest as to how to loop through and perform the update?