Replies: 1 comment 1 reply
-
How are you setting the initial value? After you change the url you will need to have a method to update the selected value after the page reloads |
Beta Was this translation helpful? Give feedback.
1 reply
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Hi there,
im trying to keep the value that is selected in my dropdown after an onchange event.
Im using RoR (Rails) to get the data, which you'll see below
<%= select_tag 'c', options_for_select(@c.pluck(:name, :id)), include_blank: '', class: 'select' %>
Obviously, without the location.href my selected value is set and also persists, however i'd like to have it persist even when im changing the url.
I tried to set the value after my reload happened, didnt quite work. (Tried it with
setValue(value, silent)
,setTextboxValue(str)
as well as fiddleling with some of the events (initialize
,load
,clear
))I didnt seem to find any other question regarding this case - would be nice if someone has an Idea how to achieve this.
€: updated my question with more information.
Beta Was this translation helpful? Give feedback.
All reactions