11-08-2002, 03:43 PM
I want to create a form which allows a person to insert a multipage article into my database. When the form page load initially there is only one textarea for the first page of the article. I want there to be buttons (links preferably, but I don't think that's possible) called "Add new page" and "Delete last page" which update the form. The thing is, when someone clicks one of those "form updating" buttons, I don't want the information in the other form fields to be lost (which is what would happen if the page reloads). I also don't want the new content saved to my database when one of those buttons is clicked. I want the content saved to my database only when the submit button is clicked. How could I go about doing this? If it's not possible, is there a better way to achieve the same thing?
11-15-2002, 01:01 PM
Yes, it's possible.
The attached file is one I did for our company intranet; it allows users to create a new "job" on the system. Among other things, it records the step details for the job: a job might consist of a number of steps, each of which can be assigned a category, description and a cost.
So when a user clicks "start a new job", opening this page, they get initially one "row" of boxes for the step details - a select box for the category, a textarea for the description and a text input for the cost.
They can then click "Add more details" and they get another, identical set of boxes to fill in. They can carry on doing this till their fingers fall off.
If there's more than one row of boxes, they also get a "Delete the last row" button.
When they finally hit "Submit", it (and it could be a bit better here, but it works) concatenates each row into a string, and then concatenates all those strings into one uber-string, and drops that into the database.
Hope it's some help.
11-15-2002, 05:29 PM
Would you please briefly state what method you used so that I know what I'm looking for? Thanks!