Form: Combo Box, Condition Not Being Executed
Posted: Tue Feb 04, 2020 2:07 pm
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)

Any help/advice is much appreciated!
$(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)

Any help/advice is much appreciated!