Forums

How to use Events Listener

Pkoll 16d ago

Hi Max

I have defined a container, but this container and the fields within must only Show when another field have some value.

I defined an events listener but I don't know how to define an "On trigger of". I have defined {data:<fieldname>}=="value", but that did not work.

Do you have an example how this works?

Greetings

Paul

kgriffin 16d ago

Hi Paul-

I have just done this on a form. You need to create the triggers on the field whose value you are using. The first trigger should be On->Document Ready, and then you need to name the trigger (in the Trigger(s) field). Say something like hide_container. The second trigger should be On->value IN, and then you put the value that triggers the container to show in the Value(s) field. Again, name the trigger, such as show_container. You may want to do a third trigger using On->value NOT IN using the same value as the prior one, so that if the value gets changed from the triggering value, you can hide the container again. Maybe name it hide_container2.

On the container itself, use Event Listeners and put the name of the trigger in and then the behavior you want (hide, show, etc). If you have fields in the container that are required, you will need to add listeners to those fields using the same triggers so that when the container is hidden, the fields are disabled and the validation is disabled and when the container is showing the fields are enabled and the validation is enabled. 

Hope that helps.

Karen

Pkoll 15d ago

Hello Karen,

Thanks for your reply. It functions. Now I can finish my form. I hope Max makes a sample form because you can't find the information you're sending

greetings

Paul

You need to login to be able to post a reply.