Page 1 of 1

Form: Combo Box, Condition Not Being Executed

Posted: Tue Feb 04, 2020 2:07 pm
by mhinnc
From the generated page source code - note the large bold line. Could it be out of place, maybe should be within the "if...!='group1' " statement ?

$(document).ready(function()
{
$("#combo_testCombobox1").change(function()
{
if ($('#combo_testCombobox1').val() == 'group1')
{
ShowObject('wb_ckbox_1', 1);
ShowObject('wb_combo_testText1', 1);
}
ShowObject('wb_combo_testText1', 0);
if ($('#combo_testCombobox1').val() != 'group1')
{
ShowObject('wb_ckbox_1', 0);
}
});
$("#combo_testCombobox1").trigger('change');
});

This link is to the page as uploaded:
https://www.websiteables.com/combo_test.php

This is the identical page, with the ShowObject moved to within the "if" statement:
https://www.websiteables.com/combo_test2.php

FYI - Using the latest 15 build.


Desired effect:
When a certain selection is made in a Combobox, two other elements (check box and text) are shown, if any other selection is made, those two elements are hidden.

What happens:
When the certain selection is made only the check box is shown, not the text. When any other selection is made, the check box is hidden.

Steps:

- Place layer on blank page: Layer > Form > General > Enable Form "checked".
- Place Checkbox and Text on Layer.
- Hide Checkbox and Text in Object Manager (or with Page > Event > On Load)
- Place Combobox on the Layer, populate with 3 items ("Item1", "Item2", "Item3")
- Combobox > Validate > Mode > Disallow First Choice "checked".
- Combobox > Conditions: If "Item2" is selected, show Checkbox and Text; If "Item1" or "Item3" are selected, hide Checkbox and Text. (see image)

Image


Any help/advice is much appreciated!

Re: Form: Combo Box, Condition Not Being Executed

Posted: Tue Feb 04, 2020 4:17 pm
by Pablo
Can you please share a demo project so I can see all your settings?

Re: Form: Combo Box, Condition Not Being Executed

Posted: Tue Feb 04, 2020 4:40 pm
by mhinnc
Sure thing:

https://www.websiteables.com/combo/combo.zip

FYI - some objects renamed. Problem remains.

Thanks!

Re: Form: Combo Box, Condition Not Being Executed

Posted: Tue Feb 04, 2020 6:14 pm
by Pablo
I'm sorry, you cannot target multiple objects with conditions, this will result in conflicting statements.
The second set of statements will undo the first statements.

I will investigate if this functionality can be added in a future update.

Re: Form: Combo Box, Condition Not Being Executed

Posted: Tue Feb 04, 2020 9:23 pm
by mhinnc
Thank you!