Hiding fields on new form until another field changes
Greetings
In the below picture, when opening a new form, the MP Location and BP Location fields should not show up until a selection in "Site" is made. Currently, when a selection in "Site" is made, the corresponding field will show up, but I want both to be hidden initially.
Here is the form:
I have the following Assignment expression in Visibility for "MP Location": [[Site]]="Millpark"&&[[Site]]!="Bellpark"&&[[Site]]!="Chambers"
I have the following Assignment expression in Visibility for "BP Location": [[Site]]="Bellpark"&&[[Site]]!="Millpark"&&[[Site]]!="Chambers"
The above expressions work to an extent:
- When "Millpark" is selected, "MP Location" is visible and "BP Location" is hidden
- When "Bellpark" is selected, "BP Location" is visible and "MP Location" is hidden
So far, so good.
What I would also like to achieve is:
- Initially, both "MP Location" and "BP Location" fields must be hidden with the correct field becoming visible only when either "Millpark or "Bellpark is selected.
- When "Chambers" is selected, both "MP Location" and "BP Location" fields must be hidden. Presently, "BP Location" remains visible.
Could you advise me on how to achieve this? Perhaps the Assignment expression is not the best way to have tried to do this?
Any help would be sincerely appreciated.
Thank you.
-
Hi Mariaan Scott,
instead of a single "=" you would have to use a double == and like this it works even easier. You don't have to check the other values.
Simply use this Assignment Expressions:
- for MP Location: [[Site]]=="Millpark"
- for BP Location: [[Site]]=="Bellpark"
This way the fields are only visible when you choose a value otherwise not.
Best
Matthias0 -
Thank you Matthias, That works just fine - I appreciate the response.
However, when the "New" form loads, both the MP and BP Location fields are visible. I would like them to not be visible when the form loads, with the corresponding one showing up only when I make a selection. I think I should start off with a false statement, is that right?
0 -
Hi Mariaan Scott,
this is strange. can you check your configuration compared to mine?
I've attached a quick screencast from my configuration where it works as expected.Best
Matthias0
Please sign in to leave a comment.
Comments
3 comments