Advice on processing a particular piece of form data

Hello, everyone,

I’m in need of some advice on processing data from a particular part of a form that I am working on. The SS dev language that I’m working in (anyone who knows me already knows) is ColdFusion.

One part of this form is being dynamically created on page load, and the number of form fields can be changed by the user via a SELECT; there can be anywhere from 0 to 25 of these form fields (actually pairs of form fields - one text input and one select.)

Since the number of form fields can vary, I originally wanted to set it so that each text input had the same name (ditto for the selects) so that the value would be a comma-delimited list of values (if more than 1). In the interest of brevity, I won’t go into any detail as to why that is not going to be the case.

Now I have it set so that whenever the user changes the value from the 0-25 SELECT, each text input field will have a name like “NAScode_x” where ‘x’ is the iterative index (ie, NAScode_00, NAScode_01, NAScode_02, etc.)

My request for advice is on the back-end, after the form is submit (via AJaX). How to go about inserting the data into the database.

There are several tables that will get data from different parts of the form. Since most of it is hard-coded, most of it will be easy. The question is: what is the best practice for inserting the data from the dynamically created pairs of elements. One form could have one, another could have 20, another could have none. How would you go about processing that data?

V/r,

:slight_smile:

(I think the edit option was removed too early. Mods, is there a way to extend the time allotted for editing a post?)

UPDATE TO PREVIOUS POST: I should add that the form is being JSON.stringify-ed prior to AJaX submit, and then deserialized on the action page, turning it into a struct. I could convert that to an array, if you think it would help solve my issue.

V/r,

:slight_smile:

1 Like

It’s set to 30 minutes forum-wide as of this moment. No way for you to extend it at this time. :frowning: .

Oh, I never thought that I would have that option. I was just curious if there was a chance that it could be set to a longer timeout, site-wide. :smile:

V/r,

:slight_smile:

2 Likes

Any suggestions appreciated. You don’t have to know CF - just the logic is all I’m seeking.

:smile:

V/r,

:slight_smile:

This topic was automatically closed 91 days after the last reply. New replies are no longer allowed.