how to get and set value from dropdown
Hi, i found out it is not easy to get or set value for this kind of drop down field in request forms,
I could figure out which element here is exactly holding the value, for example, i want to pre fill this country field by JS code to set the value as user locale.
Any suggestion? idea?
Thanks!
-
Hello Lev,
Generally speaking, what you want to do is:
- Grab the field and store it to a variable
- Have function that gets the locale
- Have a function that fills in the field based on a DOM event
Since this is custom code, we won't be able to provide specific help, but as a frontend solution, you can take a look at this interesting Medium article.
Please sign in to leave a comment.
1 Comments