I have a multiple select input in my form and I'm trying to get the selected values in my handler, but I can't, how can I get those values?
<form action="process" method="post">
<select id="new_data" name="new_data class="tag-select chzn-done" multiple="" style="display: none;">
<option value="1">111mm1</option>
<option value="2">222mm2</option>
<option value="3">012nx1</option>
</select>
</form>
My Handler:
func myHandler(w http.ResponseWriter, r *http.Request) {
fmt.Println(r.FormValue("new_data")) // result-> []
fmt.Println(r.Form("new_data")) // result-> []
}
The form serialized data with option 1 and 2 selected from JS console:
>$('#myform').serialize()
>"new_data=1&new_data=2"