I’m trying to write a Form Builder system.
Now, i reached to gathering information section and at this section i need to grouping the information to three group like:
“Short-Response” for text inputs
“Long-Response” for textarea
and “Option-Response” for radio, checkbox and dropdown
in Form page view, system create the form, based on database records.
I’m using suffix for inputs based on those group as i said earlier, like these:
<inputs name="dynamicpart_short" value="" />
<textarea name="dynamicpart_logn"></textarea>
Now, In server side i want to gather these information and group them.
I’m using
for each item in Request.Form
Next
But how i can create a loop based on inputs suffix like “_short” or “_long” and ….
means each suffix has it’s own loop!
PS:
inputs have a name with two parts, first part is dynamic and is a random numbers!
Like this: name=”15_short”
“item” will have the name of the form field, use a string function to check if it has short or long in it: