Hi,

As I was writing the form submit I noticed that enabled values are not being passed. It just returns
an empty array in the submit function.

$form['lms_manage_players'] = array(
     '#title' => t('Add Players to the Team'),
     '#type' => 'jquery_selector',
     '#description' => t('<b>NOTE:The colors indicate the following:</b><br /><ul><li><b>Pink:Players to be selected</b></li><li><b>Green: Players which are added to the team</b></li></ul>'),
     '#options' => array(
       '#enabled' => array(),
       '#disabled' => array('test1' => 'test1', 'test2' => 'test2'),
     ),
    '#default_value' => array(),
   );

But when I submit the form I do not get the values in the enabled which I moved before the submit.
I am adding log data of the form submit .
Before the form submit I moved test2 to enabled section and here is the log file

Apr 30 22:38:58  [info] $form_state = Array
(
    [storage] => 
    [submitted] => 1
    [values] => Array
        (
            [lms_manage_players] => Array
                (
                    [lms_manage_players_disabled] => Array
                        (
                            [test1] => test1
                            [test2] => test2
                        )

                    [lms_manage_players_enabled] => Array
                        (
                        )

                )

            [op] => Save Team
            [submit] => Save Team
            [form_build_id] => form-373b70d894fcc5d30b73ab4ce771e4ad
            [form_token] => aec51a45f936ac49398aa20c917682ea
            [form_id] => lms_team_player_form
        )

    [clicked_button] => Array
        (
            [#type] => submit
            [#value] => Save Team
            [#post] => Array
                (
                    [lms_manage_players] => Array
                        (
                            [lms_manage_players_disabled] => Array
                                (
                                    [0] => test1
                                    [1] => test2
                                )

                        )

                    [op] => Save Team
                    [form_build_id] => form-4de0edf50a03ae96b37be0b60c69683f
                    [form_token] => aec51a45f936ac49398aa20c917682ea
                    [form_id] => lms_team_player_form
                )

            [#programmed] => 
            [#tree] => 
            [#parents] => Array
                (
                    [0] => submit
                )

            [#array_parents] => Array
                (
                    [0] => submit
                )

            [#weight] => 0.001
            [#processed] => 
            [#description] => 
            [#attributes] => Array
                (
                )

            [#required] => 
            [#input] => 1
            [#name] => op
            [#button_type] => submit
            [#executes_submit_callback] => 1
            [#process] => Array
                (
                    [0] => form_expand_ahah
                )

            [#id] => edit-submit
        )

    [redirect] => 
)

If you need any more details pls do let me know.

Thanks

juned Kazi

Comments

liquidcms’s picture

Priority: Normal » Critical

yes, i get same thing.. possibly not setting up element correctly as i am not quite sure what the $enabled and $disabled are for - but think i have tried every combination and always get same result as posted here:

$disabled is posted as the full array as defined in the element definition and nothing is posted for $enabled (and as far as i can tell; nothing posted which has the selected (green) elements.

liquidcms’s picture

yea, pretty suer this module doesn't work - i just tried with the sample code given on the project page which has 1, 2, 3 enabled and 4, 5, 6 disabled and then i dragged 1 over to disabled and submitted. http://screencast.com/t/ODhhYWE0Mj

in the $_POST i simply get the initial settings: http://screencast.com/t/OTZmYmM1ND

liquidcms’s picture

yup, jquery simply doesn't do anything as can be seen here: http://screencast.com/t/YWIwODgwY

even though i have moved an option to disabled; the hidden "real" select field is unchanged

perhaps a jq version issue as i have 1.3.2 ? but not getting any errors - i'll see if i can track it down.

irakli’s picture

Assigned: Unassigned » lashad