Support

Akeeba Ticket System

#38465 Custom Fields - Show On Parameter - How to use

Posted in ‘Akeeba Ticket System for Joomla! 4 & 5’
This is a public ticket

Everybody will be able to see its contents. Do not include usernames, passwords or any other sensitive information.

Environment Information

Joomla! version
4.
PHP version
8
Akeeba Ticket System version
5.2.2

Latest post by tampe125 on Wednesday, 08 February 2023 08:26 CST

dunwin

 Please look at the bottom of this page (under Support Policy Summary) for our support policy summary, containing important information regarding our working hours and our support policy. Thank you!

We are starting to use ATS for Change requests to our web site and other IT Systems

For this we have a custom field that has 5 options which relate to the type of change request.

Depending on the selection of the option, we want to display additional custom field, so for instance

Option 1 - Show Custom Field A

Option 2 No additional field

Option 3 No additional field

Option 4 - Show Custom Field B

Option 5 - Show Custom Field C

I read the documentation. https://www.akeeba.com/documentation/ats-for-joomla/ticket-fields-conditional.html

I don't understand the show on ie Show Onaccess-info-toggle:1

what does access-info-toggle:1 refer to?

 

 David Unwin - London UK

tampe125
Akeeba Staff

Hello,

you're almost there.

access-info-toggle is the name of the field

1 is the value for the field.

In your case you have to create 3 additional fields and in the Show On field you have to place:

example-field:1
example-field:4
example-field:5

Where example-field is the name of the select list that is holding all the values and 1, 4, 5 are the values when the additional field should be displayed.

Davide Tampellini

Developer and Support Staff

🇮🇹Italian: native 🇬🇧English: good • 🕐 My time zone is Europe / Rome (UTC +1)
Please keep in mind my timezone and cultural differences when reading my replies. Thank you!

dunwin

Hi Davide,

Thanks for the reply. So if in my case I have 3 additional custom fields  with names 'Custom Field A' , 'Custom Field B' and 'Custom Field C'

In the show on field I would enter

Custom Field A:1 Custom Field A:4 Custom Field C:5

Is that correct(with spaces between field names)?

Kind regards

David

 David Unwin - London UK

dunwin

Ignore my last comment!

So I set up the custom field to show on 2 occasions. 

one, when the user selected the 1st option in a list on a custom field and the 3rd option.

I have attached screen shots of the 2 custom fields, which look correct to me, but the 2nd custom field does not show when I select option 1 or 3.

See the screen shot of the output in the last screen shot.

What am I doing wrong??

Kind regards

David

 

 David Unwin - London UK

dunwin

Just an update,

If I only have one access-info-toggle:1 in the Show On field it works!

So the question is how do I put the second and third in? Do I need a delimiter between them? If so what is it?

Also the custom field I am displaying is date/calendar field. Is possible to show the date in European format ie dd-mm-yyyy rather than yyyy-mm-dd

Kind regards

 

 David Unwin - London UK

tampe125
Akeeba Staff

If you want to display a field for two values, you have to use a special syntax (sorry but I had to search it):

change-type:1[OR]change-type:3

More info on this syntax here: https://docs.joomla.org/Form_field#Showon

Davide Tampellini

Developer and Support Staff

🇮🇹Italian: native 🇬🇧English: good • 🕐 My time zone is Europe / Rome (UTC +1)
Please keep in mind my timezone and cultural differences when reading my replies. Thank you!

dunwin

Reading the Joomla Doc on this https://docs.joomla.org/Form_field#Showon

I also tried setting change-type:1[OR] change-type:3 and with quotes "change-type:1[OR] change-type:3".

But again this did not work.

 

 David Unwin - London UK

dunwin

Found it! there was a space between the [OR] and the second parameter.

now with 'change-type:1[OR]change-type:3' and no spaces it works!!!

So my only question now is how to change the format of the date?

 David Unwin - London UK

tampe125
Akeeba Staff

I'm sorry but that's controlled by Joomla and it only supports YYYY-MM-DD format

Davide Tampellini

Developer and Support Staff

🇮🇹Italian: native 🇬🇧English: good • 🕐 My time zone is Europe / Rome (UTC +1)
Please keep in mind my timezone and cultural differences when reading my replies. Thank you!

dunwin

Hi Davide,

Does ATS use the standard Joomla Date formats i.e. LC4 (see screen shot)? 

If I know which one I cane use the Joomla Language override

 David Unwin - London UK

dunwin

See this also

 https://forum.joomla.org/viewtopic.php?f=808&p=3682218

 David Unwin - London UK

tampe125
Akeeba Staff

You can give it a try. However, I suspect this will work on displaying the date. When you submit the form, it will be invalid since the server code expects it in a YYYY-MM-DD format.

Davide Tampellini

Developer and Support Staff

🇮🇹Italian: native 🇬🇧English: good • 🕐 My time zone is Europe / Rome (UTC +1)
Please keep in mind my timezone and cultural differences when reading my replies. Thank you!

dunwin

Hi Davide,

Yes you are right, it displays fine. But I have set the default date using NOW and the date displayed is not today but years ago.

I will have to live with American date format. Find it hard that the Language is GB and yet the dates are American format and not European (GB)

Kind regards

David

 David Unwin - London UK

tampe125
Akeeba Staff

You're welcome!

Davide Tampellini

Developer and Support Staff

🇮🇹Italian: native 🇬🇧English: good • 🕐 My time zone is Europe / Rome (UTC +1)
Please keep in mind my timezone and cultural differences when reading my replies. Thank you!

Support Information

Working hours: We are open Monday to Friday, 9am to 7pm Cyprus timezone (EET / EEST). Support is provided by the same developers writing the software, all of which live in Europe. You can still file tickets outside of our working hours, but we cannot respond to them until we're back at the office.

Support policy: We would like to kindly inform you that when using our support you have already agreed to the Support Policy which is part of our Terms of Service. Thank you for your understanding and for helping us help you!