Highlighted
nwuest Trusted Contributor.
Trusted Contributor.
330 views

SM 9.41 - Conditional Inputs/Dropdowns

Jump to solution

Good Day,

I am trying to make it where X number of fields are invisible to the end user until a selection is made (not null) in the first drop-down box. EXAMPLE: In the photo below, I would like drop-down boxes 2-4(red) to stay invisible until an option is chosen in box 1(black).

boxes.png

I'm absolutely lost on what code I need to put in here. I have messed with the 'dep.g' form in forms designer thinking it is like the example with the visible box being checked but not sure how to turn that into code.

visible.png

I'm swimming in Kudos and need to get rid of them. Any help is mucho appreciated.

------------------------------------------------------------------------
Speed, Momentum, Intensity ... Never stop never stopping.
------------------------------------------------------------------------
0 Likes
1 Solution

Accepted Solutions
Acclaimed Contributor.. Kelalek2 Acclaimed Contributor..
Acclaimed Contributor..

Re: SM 9.41 - Conditional Inputs/Dropdowns

Jump to solution

Sorry, my mistake. It should be [$hello]<>"", which you already discovered.

Regarding the topic in general, SM help contains some articles like "Field comparisons" and "Dynamic view dependencies" which may help you when making more complex expressions.

---
Moving on, this account is no longer active. Best regards, Kelalek
- So Long, and Thanks for All the Fish
4 Replies
Acclaimed Contributor.. Kelalek2 Acclaimed Contributor..
Acclaimed Contributor..

Re: SM 9.41 - Conditional Inputs/Dropdowns

Jump to solution

Let's say Box1's input field is $hello. In that case, the visibility condition for Box2/3/4 is [$hello]=""

 

---
Moving on, this account is no longer active. Best regards, Kelalek
- So Long, and Thanks for All the Fish
0 Likes
nwuest Trusted Contributor.
Trusted Contributor.

Re: SM 9.41 - Conditional Inputs/Dropdowns

Jump to solution

Hey Kelalek2,

I have tried your solution and that seems to have the opposite effect that I was looking for.
The [$hello]="" would actually make Box 2/3/4 disappear after selecting an option in Box 1 (with Box 2/3/4 still showing at the beginning).

badtest3.pngbadtest.pngbadtest2.png

I've tried the following in the input field : [hello] <> 0 (After poking around more in the dep.g file)
This seemed to do the trick with hiding boxes 2/3/4 and upon box 1 having input in it, it then would show the remaining boxes. 

hello1.png

hello2.pnghello3.png

I do appreciate the extra push in helping me out Kelalek.

------------------------------------------------------------------------
Speed, Momentum, Intensity ... Never stop never stopping.
------------------------------------------------------------------------
Acclaimed Contributor.. Kelalek2 Acclaimed Contributor..
Acclaimed Contributor..

Re: SM 9.41 - Conditional Inputs/Dropdowns

Jump to solution

Sorry, my mistake. It should be [$hello]<>"", which you already discovered.

Regarding the topic in general, SM help contains some articles like "Field comparisons" and "Dynamic view dependencies" which may help you when making more complex expressions.

---
Moving on, this account is no longer active. Best regards, Kelalek
- So Long, and Thanks for All the Fish
nwuest Trusted Contributor.
Trusted Contributor.

Re: SM 9.41 - Conditional Inputs/Dropdowns

Jump to solution

Hey Kelalek2, 

I shall update the answer to the question as yours 🙂 I believe in healthy collaboration and I had a feeling you were on the right path just mis-read my question 🙂 

I had checked the dep.g file to see the examples after stumbling across that. I will have to check out the SM help files that are included with the server install (which i'm assuming you are talking about these), although the last time that I had used that resource I was left scratching my head more than when I had started. 

------------------------------------------------------------------------
Speed, Momentum, Intensity ... Never stop never stopping.
------------------------------------------------------------------------
0 Likes
The opinions expressed above are the personal opinions of the authors, not of Micro Focus. By using this site, you accept the Terms of Use and Rules of Participation. Certain versions of content ("Material") accessible here may contain branding from Hewlett-Packard Company (now HP Inc.) and Hewlett Packard Enterprise Company. As of September 1, 2017, the Material is now offered by Micro Focus, a separately owned and operated company. Any reference to the HP and Hewlett Packard Enterprise/HPE marks is historical in nature, and the HP and Hewlett Packard Enterprise/HPE marks are the property of their respective owners.