Topic: Multiple select field not working in SVN

Hi there,

I switched from the latest beta to the latest SVN for te comet plugin.
But i noticed the multiple select field in my application are not correctly passed.

When submitting a multiple selected field i do get back a array. But only with 1 option in it.

So where i should get back:

    [multiple] => Array

        (

            [0] => admin
            [1] => client
            [2] => agent

        )

i get only 1 selected option back:

    [multiple] => Array

        (

            [0] => admin

        )

Re: Multiple select field not working in SVN

Hi, can you please grab the latest SVN rev directly from sourceforge again? I hope that solves the issue

Re: Multiple select field not working in SVN

No luck with the latest SVN sad
When i change back to beta 4 it works again.

Any other ideas?

Re: Multiple select field not working in SVN

ok, can you please post your form markup? I'll doublecheck it in my testing enviroment and let know you when I have some results smile

Re: Multiple select field not working in SVN

A dressed down (for readability) version of my form:

<form id="form" name="form" onsubmit="return false;">
<input type="hidden" name="clientId" id="clientId" value="5">
<input type="hidden" name="mappings" id="mappings" value="true">
        <select id="selectedm2mroles" multiple="multiple" name="selectedm2mroles[]"  size="10" style="width:200px;">
                 <option title="test" value="test">test</option>
                 <option title="test2" value="test2">test2</option>
    </select>
<input value="" type="submit" id="submit" />
</form>

6 (edited by Doc 2008-03-17 8:58:38 PM)

Re: Multiple select field not working in SVN

Any news on this yet? did it work in your test enviroment?

Re: Multiple select field not working in SVN

I have the same problem, any news?

Re: Multiple select field not working in SVN

Sorry for the delay, I have been very busy lately. Unfortunatel I have to admit that this is a bug, but I'll let you know when it's fixed.

Re: Multiple select field not working in SVN

ok, rev 479 is up. I hope I didn't break anything else. Now it behaves exactly like PHP does with GET/POST/REQUEST vars.

two selects with the same name, for instance:
<select name="foo[]"></select>
<select name="foo[]"></select>

will overwrite each other.

Re: Multiple select field not working in SVN

I've updated the SVN, and it's still the same.

I have selects like this one:

<select name="lc_modules[]" size="$list_size" id="lc_moduleselect" multiple="multiple" onchange="xajax_lc_show_modules(xajax.getFormValues('workform'));              xajax_lc_exp_lang_refresh(xajax.getFormValues('workform'));">

Re: Multiple select field not working in SVN

really? Could you please doublecheck that your browser cache doesn't trick you? (FireFox is really greedy with static files).
I've done some tests with different forms and different types of multi-dimensional arrays - it was fine as it's supposed to be.

Re: Multiple select field not working in SVN

I have checked it in different browsers. The javascript part sends out only one selected option, like: (lc_modules)

xjxfun=lc_show_modules&xjxr=1206690565165&xjxargs[]=<xjxobj><e><k>page</k><v>S5
</v></e><e><k>spage</k><v>S1</v></e><e><k>lc_type<
/k><v>Smodule</v></e><e><k>MAX_FILE_SIZE</k><v>S2000000</v
></e><e><k>lc_modules</k><v><xjxobj><e><k>0</k><v>S3
</v></e></xjxobj></v></e><e><k>lc_refresh_all</k><v>S
<![CDATA[

Re: Multiple select field not working in SVN

Joseph, can you please post your form markup? I'll copy&paste it into my test scripts to see what's wrong. All my test forms work as expected.

14 (edited by joseph 2008-03-28 3:14:45 PM)

Re: Multiple select field not working in SVN

<form id="keyform" name="keyform" method="post" action="">
<select style="width:350px;" name="keys[]" size="6" multiple="multiple">
        <?php
        $db->query("SELECT id, keyword FROM "._KEYWORDSTABLE." ORDER BY keyword;");
        while($db->next_record()){
            $k = $db->f("id");
            $v = $db->f("keyword");

            print "<option value=\"".$k."\">".$v."</option>";
        }
        ?>
    </select>
</form>

and the post it sends, there were 3 elements selected:

xjxfun=add_keywords&xjxr=1206712174813&xjxargs[]=<xjxobj><e><k>keyname</k><v>S

</v></e><e><k>keys</k><v><xjxobj><e><k>0</k><v>S39

</v></e></xjxobj></v></e><e><k>aid</k><v>S8</v>

</e></xjxobj>

I think this is the usual one, but I can send the whole generated markup of the page if it helps.

Re: Multiple select field not working in SVN

the whole form would be better including surrounding elements and submit button(s).

btw: Anyone else still having issues with rev 479?

Re: Multiple select field not working in SVN

Hi,

The problem is solved, first I updated the new files in the webpage from the svn (when I noticed it's still not working).
Now, I deleted all the stuff, copied in the svn again and it works somehow smile
Thanks for the fix!

Re: Multiple select field not working in SVN

np, I'm glad to hear that it's finally working smile

Re: Multiple select field not working in SVN

hello what if im usign xajax 0.5 standard and i want to extract the values of

echo "<select id='periodo' name='periodo[]' multiple='multiple'  onChange='xajax_prueba(xajax.getElementById(\"periodo\")'>";

if i read the value it only shows me the first selecterd option and not the other ones i have selected