Hi,
I'm trying to create a form using a multiplier which all appears to be working - I can add/remove rows and the data is sent to the server on submission.
However in the case where the server side data validation fails and the user is redirected to the form to correct the data, the multiplier only shows the first row and doesn't display the additional rows - it looks like the original form with a single row. I'm not sure how to dynamically add the required number of rows to display the data.
If I hardcode the form to display additonal rows (eg 3) then these are populated with the data that was submitted so I know the data is coming back from the server, but I can't seem to get the form to display all the rows returned from the multiplier.
I'm guessing there might be some javascript I could add to determine the correct number of rows and add them by simulating clicking the "add" button but I'm not sure if that will add new rows and not populate with the existing data.
Any assistance would be greatly appreciated,
Thanks in advance.
I'm trying to create a form using a multiplier which all appears to be working - I can add/remove rows and the data is sent to the server on submission.
However in the case where the server side data validation fails and the user is redirected to the form to correct the data, the multiplier only shows the first row and doesn't display the additional rows - it looks like the original form with a single row. I'm not sure how to dynamically add the required number of rows to display the data.
If I hardcode the form to display additonal rows (eg 3) then these are populated with the data that was submitted so I know the data is coming back from the server, but I can't seem to get the form to display all the rows returned from the multiplier.
I'm guessing there might be some javascript I could add to determine the correct number of rows and add them by simulating clicking the "add" button but I'm not sure if that will add new rows and not populate with the existing data.
Any assistance would be greatly appreciated,
Thanks in advance.
Hi wade.francis,
Hmmm I don't think Max built in the code to do this. I think it should be possible but I'll have to go build a test to work it out.
Meanwhile I suggest that you add as much validation as possible in the browser to avoid the chances of serverside errors.
Bob
PS I recommend that you don't' use your email as a username here as it is publicly visible and may be scraped and spammed. PM me if you like to change it.
Hmmm I don't think Max built in the code to do this. I think it should be possible but I'll have to go build a test to work it out.
Meanwhile I suggest that you add as much validation as possible in the browser to avoid the chances of serverside errors.
Bob
PS I recommend that you don't' use your email as a username here as it is publicly visible and may be scraped and spammed. PM me if you like to change it.
Hi wade.francis,,
I was wrong - this is built in but you have to set the multiplier up to use it.
The Multiplier has to add the data to a form data sub-array called e.g. multi and add then add the the name of the sub-array into the Data Path box of the Multiplier container.
The inputs inside the Multiplier need to use the same array name e.g. multi[text1][#N#], multi[text2][#N#] where #N# is the Replacer in my Multiplier.
With these settings the size of the sub-array is used to set the initial number of multiplier elements displayed and the data is re-loaded correctly.
Note: in my test I had Hide First and Disable First set to Yes
Bob
I was wrong - this is built in but you have to set the multiplier up to use it.
The Multiplier has to add the data to a form data sub-array called e.g. multi and add then add the the name of the sub-array into the Data Path box of the Multiplier container.
The inputs inside the Multiplier need to use the same array name e.g. multi[text1][#N#], multi[text2][#N#] where #N# is the Replacer in my Multiplier.
With these settings the size of the sub-array is used to set the initial number of multiplier elements displayed and the data is re-loaded correctly.
Note: in my test I had Hide First and Disable First set to Yes
Bob
Thanks Bob - I'm not in the office for a day or two but I'll give that a go and hopefully it will be all good. I appreciate the fast reply on the query too🙂
Update - works like a charm🙂 (now that I've finally managed to get back to this task)
I had two things to change:
- In the Multiplier container, in the multiplier tab I had to populate the "Data Path" with the name of the array I was using.
- in the multiplier-contents, I had the "Field Names" a bit backwards. I had my_array[__N__][text1] instead of my_array[text1][__N__]
Thanks again for the assistance,
Qwade.
I had two things to change:
- In the Multiplier container, in the multiplier tab I had to populate the "Data Path" with the name of the array I was using.
- in the multiplier-contents, I had the "Field Names" a bit backwards. I had my_array[__N__][text1] instead of my_array[text1][__N__]
Thanks again for the assistance,
Qwade.
Hi Bob. I am facing similar issue Qwade. I have a multiplier with File Upload contents (see Screen A). I have a Captcha control on the form. When the Captcha code is invalid, I render the form. Upon rendering the form, whatever value I put into the file upload control no longer there. Is there anyway to ensure that value entered into the File Upload control is retained when Captcha code validation fails?
Hi sittsen,
Hmm . . . reloading form data is not straightforward as the files will already have been uploaded. I would suggest that you make this a multi-page form. On the first page have the Captcha and some basic inputs - name, address, etc. Then when that submits you can check the Captcha and, if all is well, show the file multi-upload inputs.
Bob
Hmm . . . reloading form data is not straightforward as the files will already have been uploaded. I would suggest that you make this a multi-page form. On the first page have the Captcha and some basic inputs - name, address, etc. Then when that submits you can check the Captcha and, if all is well, show the file multi-upload inputs.
Bob
Thank you Bob for your prompt reply. I will try what you suggested. Is captcha a client side validation? I am wondering if this is the case, whether I am avoid form reloading on failed captcha validation. Appreciate your advise on this.
Hi sittsen,
You can use any of the Captcha methods - Google ReCaptcha is a good choice. All of them rely on a server side check of some kind. You will need to reload the first page of the form on a failed validation but if there are only teh basic information inputs this should not be a problem.
Bob
You can use any of the Captcha methods - Google ReCaptcha is a good choice. All of them rely on a server side check of some kind. You will need to reload the first page of the form on a failed validation but if there are only teh basic information inputs this should not be a problem.
Bob
This topic is locked and no more replies can be posted.