Form: Combo Box, Condition Not Being Executed

Issues related to forms.
Post Reply
mhinnc
 
 
Posts: 96
Joined: Thu Dec 24, 2015 12:34 pm

Form: Combo Box, Condition Not Being Executed

Post 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!
And if I sometime confound dates and incidents, or tell the same old tale for the twentieth time, think "Oh what a vast field his laboring memory wanders."
User avatar
Pablo
 
Posts: 21577
Joined: Sun Mar 28, 2004 12:00 pm
Location: Europe
Contact:

Re: Form: Combo Box, Condition Not Being Executed

Post by Pablo »

Can you please share a demo project so I can see all your settings?
mhinnc
 
 
Posts: 96
Joined: Thu Dec 24, 2015 12:34 pm

Re: Form: Combo Box, Condition Not Being Executed

Post by mhinnc »

Sure thing:

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

FYI - some objects renamed. Problem remains.

Thanks!
And if I sometime confound dates and incidents, or tell the same old tale for the twentieth time, think "Oh what a vast field his laboring memory wanders."
User avatar
Pablo
 
Posts: 21577
Joined: Sun Mar 28, 2004 12:00 pm
Location: Europe
Contact:

Re: Form: Combo Box, Condition Not Being Executed

Post 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.
mhinnc
 
 
Posts: 96
Joined: Thu Dec 24, 2015 12:34 pm

Re: Form: Combo Box, Condition Not Being Executed

Post by mhinnc »

Thank you!
And if I sometime confound dates and incidents, or tell the same old tale for the twentieth time, think "Oh what a vast field his laboring memory wanders."
Post Reply