I have a
function calcRoute() {
var start = document.getElementById('start').value;
}
And then a
<select id=start onchange=calcRoute();>
<option value=somevalue>Dropdown 1</option>
<option value=somevalue>Dropdown 2</option>
<option value=somevalue>Dropdown 3</option>
</select>
Everything works properly. Now, instead of a dropdown list I need an input box. The problem is that I tried with
<form onsubmit=calcRoute(); method=get id=start action=#>
<input type=text id=start name=start>
<input type=submit value=Go>
</form>
But it doesn't work (it's submitting the form to the server).. you can see a demo here. Remember that I don't need the dropdown list (it's there only to prove everything works), so it can go (there's no problem of double-called function). Thanks in advance :-)