Hi all,
I am working with project that uses array index's as form names ie:
<input type=text name="id[txt_1]" >
It does this so the $HTTP_POST_VARS becomes a multidimensional array:
$HTTP_POST_VARS['id']['txt_1'] = "posted value";
post looks like this: Array ( [id] => Array ( [txt_1] => asdfasdf [txt_2] => asdfasdf [4] => 1 ) [quantity] => 1 [terms] => 0 [products_id] => 69 [x] => 16 [y] => 17 )
My problem is this. These input names are generated based on values from a MySQL table. Some of the values on the form end up being dates the end user must select. I want to be able to use a javascript popup calendar inside the form but unforetunately cannot pass the input names (as required by the js calendar) to the js script because they are array formatted.
One solution i have come up with is to rename these input names to none array formats. ie: txt_1, txt_2, txt_3 etc. and then immediately after the post i will rebuild the array with the correct indexes... I hope this makes sense.. but what i want to do is
change
this:
$HTTP_POST_VARS[txt_1]
to this:
$HTTP_POST_VARS['id']['txt_1']
after the post.
Obviously it's all dynamic so i can have as many date fields on the form as i want and they will all be changed to the correct index and have the values carried with them..
Please help... any other better ideas are GREATLY appreciated!
rw