try to add a showon property with more than 1 option:
showon="jn_val_type:18[OR]jn_val_type:11"
show only on the 2 options
it shows on all options
J4 latest (4.04)/ own module.
showon works with just one option, but as soon as i use OR or AND it does not work.
Labels |
Removed:
?
|
Labels |
Added:
No Code Attached Yet
|
text field
And what type is the jn_val_type
?
that's a list. works like a charm in j3.
This is used in multiple places in core
I can not replicate it, it works fine here. My test was on the footer module XML:
<field
name="moduleclass_sfx"
type="text"
label="COM_MODULES_FIELD_MODULECLASS_SFX_LABEL"
rows="3"
validate="CssIdentifier"
showon="jn_val_type:18[OR]jn_val_type:11"
/>
<field
name="jn_val_type"
type="list"
label="test"
>
<option value="0">0</option>
<option value="1">1</option>
<option value="11">11</option>
<option value="18">18</option>
</field>
<field
name="cache"
type="list"
label="COM_MODULES_FIELD_CACHING_LABEL"
default="1"
filter="integer"
validate="options"
>
<option value="1">JGLOBAL_USE_GLOBAL</option>
<option value="0">COM_MODULES_FIELD_VALUE_NOCACHING</option>
</field>
<field
name="cache_time"
type="number"
label="COM_MODULES_FIELD_CACHE_TIME_LABEL"
default="900"
filter="integer"
/>
<field
name="cachemode"
type="hidden"
default="static"
>
<option value="static"></option>
</field>
</fieldset>
</fields>
</config>
```
for me this is inside a subform. see attached part of module xml file
If you have mentioned that this was on a subform would be easier, so please be more specific when you describe a bug
@cloudfaction please test #35972
i downloaded the latest build (https://ci.joomla.org/artifacts/joomla/joomla-cms/4.0-dev/35972/downloads/48267/) but showon.es6.js was not in there... i have no local git environment to test. sorry i cannot test this for you.
@cloudfaction The file modified by this PR is the source file "build/media_source/system/js/showon.es6.js". in the package which you have downloaded, the compiled and minified files can be found in folder "media/system/js". These files are
So if you unzip the full package which you have downloaded into some temporary folder and copy the files mentioned above from folder "media/system/js" in the unpacked package folder to the same folder "media/system/js" in your Joomla installation, of course having made a backup of these files before so you can later change back, then you can test the PR.
Status | New | ⇒ | Closed |
Closed_Date | 0000-00-00 00:00:00 | ⇒ | 2021-11-05 17:54:15 |
Closed_By | ⇒ | richard67 |
What's the input element/form field that holds
showon="jn_val_type:18[OR]jn_val_type:11"
?