I would like to ask for help on how to submit a form multiple times. I hope I can explain the situation as clear as possible and not confusing.
Below is an example of the form:
FIELD-02 text input controls are dynamic controls, in a sense that sometimes there may be 6 input controls, sometimes there are 3 (as in the example on the screenshot).
When submitting, it should submit thrice and update as follows with 1 click of the button:
First insert: FIELD-01 and FIELD-02-A and FIELD-03
Second insert: FIELD-01 and FIELD-02-B and FIELD-03
Third insert: FIELD-01 and FIELD-02-C and FIELD-03
It should submit thrice since there are 3 FIELD-02 dynamic text input controls. If there are 6 for example, it should submit 6 times.
Is this possible?
If it is not possible this way, can the values of the FIELD-02 dynamic controls saved to an array variable then split on server side via Server Action Steps? How can we save the values to an array variable prior to submitting to the server?
In server connect there are 2 multi-actions available.
Multi insert
Multi update
To do multi insert, add this to your server action, then on the page use the Dynamic Table Generator and generate a multi insert form.
It’s the same as shown in the following dmxzone tutorial:
Just use your dynamic value in the repeat, instead of some form variable (as shown in the video)
I was thinking all of the input controls will be submitted multiple times including the dynamic controls instead of a single dynamic control at a time, when using the Multi-Insert/Multi-Update. I will check the video. Thanks @Teodor.
Okay, I seem to understand the concept.
My repeated dynamic controls should be submitted as a POST array variable and the rest should be as single POST variables.
Here’s what I have understand based on my situation:
So after doing some tests, it is all working now.
The good thing about choosing Multi-Insert query is it creates the necessary POST array and Repeat Step. Creating the Server Connect form using the multi-insert query also automates the needed code and shows how the dynamic controls are set up. From this, we can select which controls can be submitted as dynamic and which are not.
Dynamic controls are passed to the server as POST array variables. The non-dynamic ones can be passed as normal POST variables. The repeat step will iterate the POST array variable items one by one, and from that the insert/update query can be performed.
@zitroware great that you managed to create your form, using the multi-insert generator.
Indeed it’s the easiest way yo auto-generate the post vars and the inputs on the page then.