Dynamic form field as a block

Vote:
 

I have a fixed form block (not Episerver forms) which has some standard form fields.

I want to add a Content Area which allows additional, dynamic form fields to be added to the form.

The question I've got it is, when a Post back of the block is performed, how would I retrieve the values from the items in the content area?

Has anyone ever managed to achieve this, or has some example / pointers that can help?

Thanks!

#180767
Jul 25, 2017 18:30
Vote:
 

IMHO solution could be following (also depends on what you gonna do with submitted data afterwards):

  • while postback happens on the server you have access to current page
  • get info about added blocks to that forms "dynamic section" from ContentArea
  • every block should implement some known interface via which you could understand name of the posted field (to find it in incoming request)
  • then you can loop through those blocks and for each block find posted value in incoming Http request

What you do later with these collected values - depends on requirements.

#180769
Jul 25, 2017 21:38
* You are NOT allowed to include any hyperlinks in the post because your account hasn't associated to your company. User profile should be updated.