Help Please! Dropdown won't retain selected option

newbie-question

#1

Hey everyone,

I’m having trouble with my dropdown state remaining once I go forward or back a page.

I’m able to use a global variable to keep the text in the text input, but unsuccessful with the dropdown.

Please help!


#2

Keep in mind that you’ll also need to set the selected option to the variable value when the page/widget loads. Here’s an example: retain-selection.rp (55.6 KB)


#3

living_expenses.rp (487.0 KB)

File attached


#4

Take a look at my example above. I see you’ve created a lot of global variables, but you don’t appear to actually be storing any information in them.

The steps needed to preserve the information are:

  • when the user enters text into a text field, or makes a selection from the dropdown, set the value of the corresponding global variable to their input/selection. In your file you aren’t doing this, but the browser is “helpfully” keeping your text input values, which makes this a tricky lesson to learn.
  • When the page loads, set the text input fields to the values of their corresponding variables, and set the selected droplist options to the values of their corresponding variables.

Hope this helps.