Error in dynamic text when dropdown only has one option

Hi All,

Hope someone can help :slight_smile:
This is the page:


User actions on the page:

  1. user selects brand in the first dropdown.
  2. products associated with the brand selected appear as options in the second dropdown
  3. user selects a product from the second dropdown
  4. user hits “display” button
  5. the text in red changes to display the product that user has selected

scenario 1: Brand A has more than one product → user select one product from the list in the second dropdown and hits the button → the text in red displays the name of the product selected

scenario 2 (the problem) : brand B only has one product → user selects the only product that appears in the second dropdown and hits the “display” button → the red text box disappears .

This is my onClick event code, in case I have missed anything
var attempt = 100;
export function displayButton_click(event) {
$w(‘#text41’).text = $w(“#productList”).value
}

Thank you for any help!
Letizia

Hello Letizia

would you please provide your editors link.
Thanks

Massa

Hi Massa,
super sorry as I am new to this, how exactly can I provide that?
thank you in advance

Just copy your editor (or website) url and paste it here , only wixCode experts have the authority to view your editor in order to provide as much help as possible

@massasalah18 thanks a lot Massa, I can’t acccess the editor from my mobile but I will send as soon as I can!

1 Like