开发者

How can I hide a specific child of a fieldset element?

I need to hide only one of the 2 children of a fieldset element.

I have an issue with the assigning the #type='hidden' value to 2 children elements of a fieldset.

In other words I have:

Array
(
    [4] => Array
        (
            [#type] => hidden
            [#title] => Distribution Product
            [#default_value] => Array
                (
                )

            [#options] => Array
                (
                    [] => - None selected -
                    [0] => stdClass Object
                        (
                            [option] => Array
                                (
                                    [38] => Cosmetics
                                )

                        )

                    [1] => stdClass Object
                        (
                            [option] => Array
                                (
                                    [39] => Hair
                                )

                        )

                )

            [#description] => 
            [#multiple] => 0
            [#size] => 0
            [#weight] => 0
            [#theme] => taxonomy_term_select
            [#required] => 0
        )

    [1] => Array
        (
            [#type] => select
            [#title] => Product
            [#default_value] => Array
                (
                    [0] => 26
                )

            [#options] => Array
                (
                    [] => - None selecte开发者_运维百科d -
                    [0] => stdClass Object
                        (
                            [option] => Array
                                (
                                    [28] => Cosmetics
                                )

                        )

                    [1] => stdClass Object
                        (
                            [option] => Array
                                (
                                    [26] => -Joelle Ciocco
                                )

                        )


                )

            [#description] => 
            [#multiple] => 0
            [#size] => 0
            [#weight] => 0
            [#theme] => taxonomy_term_select
            [#required] => 0
        )

    [#type] => fieldset
    [#title] => Vocabularies
    [#collapsible] => 1
    [#collapsed] => 
    [#weight] => -3
    [#tree] => 1
)

I'm currectly assigning

$form['taxonomy'][4]['#type'] = 'hidden';
$form['taxonomy'][1]['#type'] = 'hidden';

But they are both visible.

Of course if I hide

$form['taxonomy']['#type'] = 'hidden';

it works and I hide everything.

thanks


What if you try

unset($form['taxonomy'][4]);
0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜