BWCWeb
November 28, 2023, 2:39pm
1
i have a website with a Request.Querystring labeled ‘injury’
I am trying to show a div when only a condition is met. Here is what i have as my dmx-show on the div
dmx-show="(query.injury != ('Skin Disorder'||'Emergency Care'))"
so if the query is Skin or Emergency, i don’t want that div to show, but any other injuries i do.
Its working correctly for the Skin Disorder, but not for Emergency Care. Is this not written correctly?
Teodor
November 28, 2023, 2:44pm
3
The code that you need is:
query.injury !='Skin Disorder' || query.injury !='Emergency Care'
And it’s correctly generated when using the expression builder:
1 Like
Can we use spaces in the queries parameter values?
Teodor
November 28, 2023, 2:55pm
5
Well the spaces in the URLs are replaced by %20
-> Skin%20Disorder
so there are no issues with that.
1 Like
BWCWeb
November 28, 2023, 2:56pm
6
so that is what i originally thought and had my coding. However, it doesn’t work as intended.
<div class="card pt-2 pl-2 pr-2" dmx-show="query.injury!='Skin Disorder'||query.injury!='Emergency Care'">
It shouldn’t be showing the Guided SOAP card
When i use my link
ATGenius - Athletic Trainer Injury Record Management it shows the Guided Soap card
Teodor
November 28, 2023, 2:57pm
7
I don’t have access to this page, as it requires login.
BWCWeb
November 28, 2023, 3:01pm
8
i disabled the security so you can check.
Teodor
November 28, 2023, 3:08pm
9
If i properly understand the logic, i think you need AND instead of OR here.
query.injury !='Skin Disorder' && query.injury !='Emergency Care'
1 Like
BWCWeb
November 28, 2023, 3:12pm
10
ahhh…yup that did it. I guess i was just thinking about it wrong. Thank you so much!!
1 Like
Antony
November 28, 2023, 5:06pm
11
On the spaces topic, I hand code all of my dmx-shows and it works with spaces, new lines and many levels of brackets!
1 Like