joomla / joomla-framework

[READ-ONLY] This repo is no longer in active development. Please see https://github.com/joomla-framework for the individual Framework packages.
http://framework.joomla.org
GNU General Public License v2.0
189 stars 140 forks source link

JForm -> Showon does not work if field has multiple=true #376

Open e-it opened 9 years ago

e-it commented 9 years ago

Hello,

I just mentioned a little bug: If I want to use https://docs.joomla.org/Form_field#Showon I can not use the multiple-tag on the field that should be hidden, if field one has the value 0.

Example:

<field name="foo" type="list"

<field name="bar" type="category" extension="com_test" multiple="true" showon="foo:1" />

izharaazmi commented 9 years ago

@SPQRInc Please use code block to put your example code. Currently it appears broken.

e-it commented 9 years ago

Oh, I'm sorry...

<field
    name="foo"
    type="list"
    >
    <option value="1">JYES</option>
    <option value="0">JNO</option>
</field>
<field
    name="bar"
    type="category"
    class="inputbox"
    extension="com_test"
    multiple="true"
    showon="foo:1"
/>

I also do not see an error in my Browsers Webdeveloper-Error-Console.

e-it commented 9 years ago

Hello again,

the other way around it does not work, too:

<fieldset   name="additional">
    <field  name="usergroup" 
            type="usergroup"
            label="COM_TEST_FIELD_USERGROUP"
            description="COM_TEST_FIELD_USERGROUP_DESC" 
            />
    <field
            name="bar"
            type="text"
            showon="usergroup:8" />

works, but

<fieldset   name="additional">
    <field  name="usergroup" 
            type="usergroup"
            multiple="true"
            label="COM_TEST_FIELD_USERGROUP"
            description="COM_TEST_FIELD_USERGROUP_DESC" 
            />
    <field
            name="bar"
            type="text"
            showon="usergroup:8" />

does not work (it's always visible here).

And (as I already said) the other way round does not work, too:

<field
    name="foo"
    type="list"
    >
    <option value="1">JYES</option>
    <option value="0">JNO</option>
</field>
<field
    name="bar"
    type="category"
    class="inputbox"
    extension="com_test"
    multiple="true"
    showon="foo:1"
/>