I’m stuck trying to work out the best possible way to approach this.
Basically, I have in interface that administrates form inputs. That is, this interface is in charge of the inputs that are displayed and utilized on another interface. I have multiple input types – text input, textarea, select, etc. So, from an administrator point of view, almost all of the controls are text inputs, but for each ‘user-side’ input, that’s several text inputs, the number of which varies depending on the ‘user-side’ input.
For example, the administration fields for a single text input are: name, id, and description. For a textarea, they’re the same. For a select input, I might have name, id, description, and then a series of ‘value’ and ‘title’ inputs for the select’s options.
So here’s where I’m stuck. I need to work out the best way to assign names to these inputs in the administration side so that when I click ‘save’, I can group the relevant inputs together.
Right now the form would just be a series of inputs like this:
input, text [name for input 1]
input, text [id for input 1]
input, text [description for input 1]
input, text [name for input 2]
input, text [id for input 2]
input, text [description for input 2]
input, text [name for field 3]
input, text [id for field 3]
input, text [description for field 3]
input, text [option value 1 for select field 3]
input, text [option title 1 for select field 3]
input, text [option value 2 for select field 3]
input, text [option title 2 for select field 3]
input, text [option value 3 for select field 3]
input, text [option title 3 for select field 3]
input, text [name for textarea 4]
input, text [id for textarea 4]
input, text [description for textarea 4]
Would it perhaps be possible to delineate ‘groups’ of inputs using a hidden ‘input_type’ field (probably necessary anyways)?
I hope that made some sense. I’m basically looking for a way to delineate/group inputs from a single form POST set.
You can create PHP array structures with your form names like so.
Would yield:
You should be able to work out some form of structure that will work for your needs.