Welcome to the nuBuilder forums!

Please register and login to view forums and other content only available to registered users.

Display Condition Help

Post Reply
Richsurvey
Posts: 12
Joined: Fri Sep 11, 2015 7:50 pm

Display Condition Help

Unread post by Richsurvey »

Hi,

Need help to get a field (dropdown) that should only be visible when a checkbox is ticked.

i.e.: I have a checkbox field called checkbox1 and a dropdown field called dropdown1. When checkbox1 is ticked I want dropdown1 to be visible.

In dropdown1 I have the following SQL code in the "Display Condition":

Code: Select all

SELECT IF('#checkbox1#' = '1', '1')
I've tried other syntax, but nothing I've tired seem to work.

Can anybody help me write the proper SQL code?

Thanks!
admin
Site Admin
Posts: 2783
Joined: Mon Jun 15, 2009 2:23 am
nuBuilder Version: 4.5
Been thanked: 3 times

Re: Display Condition Help

Unread post by admin »

Richsurvey,

Try this

Code: Select all

SELECT IF('#checkb#' = '1', '1','0')
Steven
Richsurvey
Posts: 12
Joined: Fri Sep 11, 2015 7:50 pm

Re: Display Condition Help

Unread post by Richsurvey »

Hi Steven,

Thanks for the help. I've tried the code and I didn’t receive an error, but when I click on checkbox1, dropdown1 does not appear….? Do I need to write a script to update the state of dropdown1 when checkbox1 is changed? If so, would you be able to help me with this? or hopefully guide me in the right direction.

Thanks!
admin
Site Admin
Posts: 2783
Joined: Mon Jun 15, 2009 2:23 am
nuBuilder Version: 4.5
Been thanked: 3 times

Re: Display Condition Help

Unread post by admin »

Richsurvey,

See if you can hide it by simply doing this..

Code: Select all

SELECT '0'
I suggest trying a few this until you get to understand it.

If you try

Code: Select all

SELECT IF('#checkbox1#' = '1', '1')
Does it give you an sql error in the debug table and is it converting #checkbox1# to a value?

Steven
Post Reply