function readOnly(count){ }
Starting November 20, the site will be set to read-only. On December 4, 2023,
forum discussions will move to the Trailblazer Community.
+ Start a Discussion
Chirag MehtaChirag Mehta 

How to Generate HTML form(s) (with a specified action and set of hidden fields) dynamically

I want to generate HTML form(s) (with a specified action and set of hidden fields) dynamically i.e., based on user action on main form sub/child forms should get added

To make it more clear,
Main Form: Prompt to enter file information and description
Sub Forms: As soon as someone clicks Add file button on Main Form, sub/child forms need to be dynamically created and added in the below Attachments data table

Data table gets generated using controller, but dynamic form generation with hidden fields (input type file and submit button) seems not feasible. Any help would really ease my work, so request to please update that how can we generate HTML forms dynamically.

Best Answer chosen by Admin (Salesforce Developers) 
Saurabh_RawaneSaurabh_Rawane
Declare a Page Block Section in your VisualForce Page, on Click of Add File rerender the page block section, have repeat tag inside the Page Block Section which dynamically adds forms into your page.
 
If anyone else have a better way of doing this, please suggest.
 
Thanks
Saurabh