lfRestrictSelectOptions does not show the desired effect

Good evening,

I have a live field where I want to hide certain options depending on the user. I have 10 different options (A - J) and want to show options A - E for user 1 and E - J for user 2. If one of these two users selects option E, another text field should appear. 

 

To achieve this I wrote something like:

 

lfRestrictSelectOptions("field", {"A", "B","C","D"});
if(argv["field"] == "E") {
lfShow("textfield");
}
else {
lfHide("textfield");
}

 

and 

 

lfWatch("field",allFields, "Hook.sil");

 

Everything works, except that, if a user makes a selection, the "field" immediately jumps back to NONE. 

If I use

lfWatch("field",allFields, "Hook.sil", {"keyup"});

 I does not jump back to NONE, but the hidden text field does not appear, if a user selects option E.

 

 

0 answers

Suggest an answer

Log in or Sign up to answer
How to earn badges on the Atlassian Community

How to earn badges on the Atlassian Community

Badges are a great way to show off community activity, whether you’re a newbie or a Champion.

Learn more
Community showcase
Published Tuesday in Marketplace Apps

If you’re an Atlassian app developer, you’ll want to know about Atlas Camp!

This September 6-7, hundreds of Atlassian App developers will flock to Barcelona Spain to build skills, discover product roadmaps, meet face-to-face with the Atlassian team, and learn how to extend t...

112 views 0 3
Read article

Atlassian User Groups

Connect with like-minded Atlassian users at free events near you!

Find a group

Connect with like-minded Atlassian users at free events near you!

Find my local user group

Unfortunately there are no AUG chapters near you at the moment.

Start an AUG

You're one step closer to meeting fellow Atlassian users at your local meet up. Learn more about AUGs

Groups near you