This is continued from here: Javascript / jQuery - Goto URL based on Drop Down Selections
Some great folks have given me some code examples, but I am having real trouble on where to insert the code in my example form.
Can someone let me know where exactly the code provided in the previous question location should be added in a form to work properly?
Somewhere in your JavaScript file you need to bind a function to the
onsubmit
event of your form, so it can do whatever you want.If you are using jQuery do this:
Check how it works here: http://jsfiddle.net/WDtGK/2/
added HTML for context
In Javascript: