I need to set selected option for select element, rendered with Play Framework helper.
In the docs https://www.playframework.com/documentation/2.5.x/api/scala/index.html#views.html.helper.select$ I didn't find example how to do it.
I tried to do it like this, but still default value is selected:
field = form("selectedCategory"),
options = categoriesSeq,
'_default -> "Choose One",
'_label -> "Select category",
'selected -> "1"
You may want to look at how use play forms.
In your code, what is the variable
It should be a
play.api.data.Form instance, passed into your view, from your controller.
I hope this helps.