Jump to content

Drop Down as Array


delickate

Recommended Posts

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

Link to comment
https://forums.phpfreaks.com/topic/258843-drop-down-as-array/
Share on other sites

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

Link to comment
https://forums.phpfreaks.com/topic/258843-drop-down-as-array/#findComment-1326940
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.