This topic is locked

Dynamically Add Any Number of Textboxes on Add Form

9/20/2011 11:06:17 PM
ASPRunnerPro General questions
D
dorlisa author

I would like to dynamically generate a series of textboxes incrementally on an add page form as needed for the fields "Member" and "Role" per row.
I would like the user to click an "Add" button on the form and it creates two textboxes that can be lookup fields for "Member" and "Role". Then the user can click "Add" again and it incrementally creates another row of two text boxes for "Member" and "Role".
Is there a way to do this?

Sergey Kornilov admin 9/21/2011

I guess you can do that (adding additional fields) using jQuery. The main question is where do you want to save data that is entered there.

D
dorlisa author 9/21/2011

This form saves its data in the table called "pc_dashboard". This table has each "role" as a field in the table as an "int" datatype. The "int" datatype links to the "memberID" of the Member's table called "pc_roster".
So, the role selected should be mapped to the field for that role. And the "member" that is selected to be linked to that role via the "Add" button for this particular form submission should be added to that role's field in the "pc_dashboard" table.
And I would like to be able to click an "X" to delete any "Member/Role" row.

Sergey Kornilov admin 9/22/2011

If you need to save additional rows in another table - use master-details relationships. ASPRunnerPro allows you to Add/Edit data in both master and details tables on the same page.
You can add as many details records as you need.