Complex PHP Form Data -


i have form multi-level tree of 1 many relationships. example:

match -> phase 1 -> phase property 1       -> phase 1 -> phase property 2        -> phase 2 -> phase property 1       -> phase 2 -> phase property 2       -> phase 2 -> phase property 3        -> phase 3 -> phase property 1       -> phase 3 -> phase property 2 

so, on front-end able add many phases match , many phase properties phase.

in php back-end, able represent data in multi-dimensional array, can loop through phases , loop through each phase's properties. ideally, stay away managing ids/names through javascript.

i know can receive array in php using this:

<input type="text" name="phases[]" /> 

but, how continue pattern properties? can like:

<input type="text" name="phaseproperties[][]" /> 

and somehow "link" each property right phase?

if input fields appear on static page, should know how input fields going make on server side. why using fields like:

<input type="text" name="phaseproperties[0][]" /> <input type="text" name="phaseproperties[0][]" /> <input type="text" name="phaseproperties[1][]" /> 

such bad thing? if fields being dynamically (client-side) generated there shouldn't problem naming them dynamically aswell. seem constraining no apparent reason.


Comments

Popular posts from this blog

asp.net - repeatedly call AddImageUrl(url) to assemble pdf document -

java - Android recognize cell phone with keyboard or not? -

iphone - How would you achieve a LED Scrolling effect? -