let’s say I have a select list as follows:
<select name='languages'>
<option value='german'>German</option>
<option value='english'>English</option>
</select>
How do I, with javascript/jQuery refresh the page when the user selects a language and add a Named parameter style parameters to the end of my url every time the user smakes a choice, for example, if the user selects german, the url should look like:
http://my_app/my_controller/my_action/language:select_option_value_for_german
If the user selects english, the url will be:
http://my_app/my_controller/my_action/language:select_option_value_for_english
So, everytime the user makes a selection, the same page is refreshed with the named parameters added at the end of the url.
NOTE : I want the named parameters to appear only once per request, in other words, I don’t want them to repeat at the end of the url like:
http://my_app/my_controller/my_action/language:select_option_value_for_german/language:select_option_value_for_english
Any help is very appreciated
Thank you
In your js file listen to change event on your select and build the url and navigate to the built url.
Change your selectbox with default value, for you to select the German in every refresh. I miss to notice that every refresh the default is german that is why you always get english