I have two tables:
parent
parentid
parentname
child
childid
parentid
childname
childage
This is my initial html
<form>
parent name: <input type="text" name="parentname"><br>
children: <input type="text" name="child1"> Age:<input type="text"
name="ageforchild1"> <a href="questionhere.link">Add Child Field</a>
</form>
I have two questions here. One is what is the code in adding a childfield link link so that when I click that, another forms will be generated or the code above will become like this after I click the add child filed
<form>
parent name: <input type="text" name="parentname"><br>
children: <input type="text" name="child1"> Age:<input type="text"
name="ageforchild1"><br>
children 2: <input type="text" name="child2"> Age:<input type="text"
name="ageforchild2"> <a href="questionhere.link">Add Child Field</a>
</form>
Another question is how to insert this into database since this will insert into the parent table and multiple row for the child table.
I want to have like what is in gmail. In gmail, if you edit/add your contacts, you can observed that forms will be generated on same page if click add field.
Thank you.