Contional Fields Javascript Problem

I have…

  • [X] Checked the logs and have uploaded a log file and provided a link because I found something suspicious there. Please do not post the log file in the topic because very often something important is missing.

I’m submitting a…

  • [ ] Regression (a behavior that stopped working in a new release)
  • [X] Bug report
  • [ ] Performance issue
  • [ ] Documentation issue or request

Current behavior

cr = Relational Field (String Title)
worktype = Relational Field (String Title)

Hide | cr | Javascript : data.worktype.iv[0] != ‘43eac819-15c3-4887-9e72-77031a92e427’ || data.worktype.iv[0] != ‘de31e2ff-d4ce-4a41-b879-68fcd36897ed’
’||’ in conditional fields operator does not work properly.

data.worktype.iv[0] != ‘43eac819-15c3-4887-9e72-77031a92e427’ working.

data.worktype.iv[0] != ‘43eac819-15c3-4887-9e72-77031a92e427’ || data.worktype.iv[0] != ‘de31e2ff-d4ce-4a41-b879-68fcd36897ed’ not working.

Environment

  • [ ] Self hosted with docker
  • [X] Self hosted with IIS
  • [ ] Self hosted with other version
  • [ ] Cloud version

Version: [5.3]

Browser:

  • [X] Chrome (desktop)
  • [ ] Chrome (Android)
  • [ ] Chrome (iOS)
  • [ ] Firefox
  • [ ] Safari (desktop)
  • [ ] Safari (iOS)
  • [ ] IE
  • [ ] Edge

Hi, I am already working on this.

Does it only happen with this example or also with other conditions?

Hi, thanks for the quick response.
Generally I am having problems in multiple conditions.

Are you sure you are not meaning && ???

So hide field B if neither Reference 1 nor Reference 2 is selected?

i need to ;

if worktype selected value in (x or y is not selected) hide cr field

in the current condition I use to ‘||’ . i dont use &&.

Yes, but the negation of

(X == 1 || X == 2) (either 1 or 2 selected)

is

!(X == 1 || X == 2)

or

(X != 1 && X != 2)

I try to !(X == 1 || X == 2)

it’s worked.

Thank you for your interest.

1 Like