Click to See Complete Forum and Search --> : Dynamic Rows for a Form


teeluck
12-26-2006, 09:15 PM
Hey,I'm a junior at web programming,recently graduated from school.I have been working on a project where I got stuck.Here's my problem:

I have HTML page with a form.In the form I have a table row where there are four textboxes to enter information.

I want to be able to dynamically increment these rows,so that I can enter another row of information,(as many as required).

I want these rows of information to be passed to a JSP so that I can enter the values into a MYSQL DB.

I tried using Jscripts,but I cannot get the textbox names for each increment to be passed to the JSP,I only get the first row of texboxes to be passed.

I basically want to be able to add or remove rows when required.And store the values in a MYSQL DB.

Are there any suggestions?Is there another way to go about this?

whutupbioootch
12-27-2006, 12:59 AM
Hi. I would suggest changing your form to include fields for the worst case scenario and hiding all but the first set of fields when the page is loaded. For example, if your form that has 4 fields for every book: title, author, pages and genre and at most the user would be entering in 5 books. I'd include 20 fields, hide all but the first four fields using Javascript with the onload event and finally include a button that unhides the other sets of fields as needed. I hope this helps.