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
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
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • 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.