mercredi 9 août 2017

Form field 'showon' parameter for unchecked checkbox

I always used showon="checkboxname" to show an input field if a checkbox is not checked and showon="checkboxname:1" to show it if a checkbox is checked.

Simplified example:

<?xml version="1.0" encoding="utf-8"?>
<form>
    <fieldset>
        <field name="rmvOptionA" default="0" type="checkbox"/>
        <field name="OptionA" type="text" showon="rmvOptionA"/>
    </fieldset>
</form>

This worked well for me until Joomla 3.6.5.

But showon="checkboxname" (unchecked checkbox) isn't working in Joomla 3.7. showon="checkboxname:1" still works fine.

I tried

  • showon="checkboxname:0"
  • showon="checkboxname!:" (from here)
  • showon="checkboxname!:1" (from here)
  • and any combination of it that came to my mind.

I know that the colon is used for the value of a field and that checking a checkbox won't change its value. But is there a workaround for Joomla 3.7?




Aucun commentaire:

Enregistrer un commentaire