Page 1 of 1

Display Condition Help

Posted: Thu Jan 21, 2016 7:58 pm
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!

Re: Display Condition Help

Posted: Thu Jan 21, 2016 11:39 pm
by admin
Richsurvey,

Try this

Code: Select all

SELECT IF('#checkb#' = '1', '1','0')
Steven

Re: Display Condition Help

Posted: Fri Jan 22, 2016 4:24 pm
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!

Re: Display Condition Help

Posted: Mon Jan 25, 2016 5:44 am
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