delickate Posted March 13, 2012 Share Posted March 13, 2012 Hi, I've a two select box with same name enabled multiple. like this <select name="saniSelect[]" multiple = "multiple"> <option value="a">a</option> <option value="b">b</option> <option value="c">c</option> </select> <select name="saniSelect[]" multiple = "multiple"> <option value="d">d</option> <option value="e">e</option> <option value="f">f</option> </select> Now from select box first i select "a" and "c" and from 2nd select box i just select "f" when i submit the form. and watch the result like this: print_r($_REQUEST['saniSelect']); it should return like this: Array([0] => Array([0]=>a, [3] => c), [0] => Array([3]=>f), ) which is what i want .but it didn't.. it shows like this Array([0] => Array([3]=>a, [3] => c)) why i'm not getting my require result.. it should become array onto an array.. means multidimensional array Please help Quote Link to comment https://forums.phpfreaks.com/topic/258843-drop-down-as-array/ Share on other sites More sharing options...
Muddy_Funster Posted March 13, 2012 Share Posted March 13, 2012 I wouldn't rely on a form for this, just pass two individual arrays and put them into a multi dimensional array on the php page at the end. Quote Link to comment https://forums.phpfreaks.com/topic/258843-drop-down-as-array/#findComment-1326932 Share on other sites More sharing options...
delickate Posted March 13, 2012 Author Share Posted March 13, 2012 thanks for reply.. if you name any textbox as array and make it copy... it'll become array of different indexes... and if that select box will return array then it should return array into array.. i know if i change each select box name to make them two diff array then i'll get the required result. but this is not my requirement. My form is dynamic and it require such demand... so please help me on this............. Thanks Quote Link to comment https://forums.phpfreaks.com/topic/258843-drop-down-as-array/#findComment-1326940 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.