Forums

add fields depending on selection

jev 20 Oct, 2010
Sorry i am sure there are answers here somewhere on what i want to do but i dont know keywords to search for.

I want to create a form where there will be fields like the following;

Child 1
name
date of birth

child 2
name
date of birth

child 3
name
date of birth

child 4
name
date of birth

instead of having child1 - child-20 listed on the form i would like some sort of button so they can click to get the extra fields.

Click here to add new child


Is this possible? IF so what should i look for to find out how to do it.

thanks in advance
Nat
GreyHead 21 Oct, 2010
Hi jev,

Yes it's certainly possible and there are some examples here - but quite long time ago I think.

The simplest way is to set up an array of inputs but to hide them all until the button is clicked (you use a little JavaScript for that part).

Bob
This topic is locked and no more replies can be posted.