Page 1 of 1

Adding section in form depending on user

Posted: Tue Dec 16, 2008 10:29 pm
by Peuplarchie
Good day to you all,
here i come again with a probably easy question for you but I can't find what i'm looking for.


What I have:
Simple form....

Code: Select all

 
<input name="artist" value="Artist" />
<input name="country" value="Country" />
 
<input name="cd" value="Album" />
<input name="year" value="year" />
<input name="price" value="price" />
 

MY GOAL:


Have a link that would add a section into the form dynamicly with out reloading of the page. (add an album from this artist)

Code: Select all

 
<input name="cd" value="Album" />
<input name="year" value="year" />
<input name="recorded" value="Recorded" />
 

BUT:
Here is the twist, I need to be able if to add another section for DVD.
Different field is required for this...

Code: Select all

 
<input name="DVD" value="DVD" />
<input name="year" value="year" />
<input name="where" value="where" />
 

I know there will be some JS and CSS but I think the core could be PHP.


Thanks for any help, I still searching, directions would be nice...

Re: Adding section in form depending on user

Posted: Tue Dec 16, 2008 11:08 pm
by jawedshamshedi
Hi,
How are you???
As I can get from your question that you want to add some more fields in your form on some specific condition, like if this condition is true then these more fields can be seen.
If i am right then you should write all the fields in your form and the fields that your can to show when a condition is match, write them in if condition, this will not make the page reload as well.

Hope i got your question right and my answer could be of little help.

Re: Adding section in form depending on user

Posted: Tue Dec 16, 2008 11:13 pm
by Peuplarchie
Good, you ?
The user should be able to choose which "kind of" section he/she wants to add.
You got my point but not that part.
Also, i don't know how many the user want to add... could be lots.