I’m trying to show whatever value from my dropdown menu that was selected, onto my local server.
Here’s my HTML from the page with the dropdown:
<select name="jdbcDriver" id="jdbcDriver" onchange="$('#submit').prop('disabled', $('#jdbcDriver option:selected').val() == 'default')">
<option selected disabled value="default">Select Driver</option>
<option value="1">SQL Server</option>
<option value="2">Oracle</option>
</select>
And in my function I have:
func AddProgram(responseWriter http.ResponseWriter, r *http.Request) {
r.ParseForm()
page := Model.Page{
TemplateFilename: []string{"NewProgramData.template.html"},
ObjectMap: objectMapDefinition{
JdbcDriver: r.FormValue("jdbcDriver"),
},
}
Ui.Render(responseWriter, page)
}
and then finally in my NewProgramData.template.html, I am doing this:
{{ .ObjectMap.driver}}
However nothing shows up. I would be grateful for any help, thanks.