Results 1 to 13 of 13
Thread: Add form elements on the fly
Aug 1, 2007, 13:47 #1
Add form elements on the fly
I'm creating a news section for a CMS in PHP and mySQL in which I have a text field for the headline and an textarea for the article. Instead of making the user add each article one-at-a-time I would like to know if there's a way to dynamically create/remove these elements with a button?
for instance; at page load the form contains 1 article - it has 1 text field and 1 textarea. The user decides that he wants to add 2 more articles, so he clicks the "add" button twice. Now the form has 3 articles (3 text fields and 3 textareas), each with a unique id (art1_head,art1_txt, art2_head,art2_txt, art3_head,art3_txt).
Then, I also need to have a button or checkbox to remove each article.
Forgive my ignorance. I'm not a js guy, I work in PHP. Is this possible?