Using this documentation https://docs.joomla.org/Form_field I have developed a plugin and used the showon
attribute within the XML (head to the bottom of that page).
Whilst is shows me I can use
showon="foo:1[AND]bar:1"
and
showon="foo:1[OR]bar:1"
I would like to showon based on whether a text field is not empty. Is this a possibility or will I require JS?
I have also heard you can do showon="field1!:1"
and showon=field!"
Here's my code which shows both fields.
<field
name="telephone"
type="text"
label="MOD_HEADER_CONTACT_TELEPHONE_LABEL"
description="MOD_HEADER_CONTACT_TELEPHONE_DESC"
default=""
class=""
/>
<field
name="countrycode"
type="text"
label="MOD_HEADER_CONTACT_COUNTRY_CODE_LABEL"
description="MOD_HEADER_CONTACT_COUNTRY_CODE_DESC"
default=""
class=""
required="required"
showon="telephone!:"
/>