A form has an onsubmit event that can be used for this purpose and then, if you return false, the form will not actually be sent.
e.g.
Code:
<form onsubmit='yourFunction(); return false'>
<input type='text' value='etc'>
<input type='submit' value='Go'>
</form>
Rather than using the inline onsubmit, you could also append a listener to the form that does the same thing but keeps your HTML tidy. You could equally not use a submit button at all and instead replace it with a normal button type that has a click handler, however this will fail if the user hits enter rather than clicks the button.
To get the value of the drop-downs within yourFunction() you can just use ids or names through standard methods.
For that page, I would suggest you scrap the idea of using a form to create the links and instead use click events for the nodes, so to join node 1 to node 2 you would click them in that order. This wouldn't be possible with multiple click handlers as the nodes are within the canvas and are therefore cannot have listeners assigned. Instead, once you calculate their position a single click handler on the canvas could determine which, if any, was clicked and take the necessary action.
If the path is Hamiltonian (it is similar also to check for a full hamiltonian cycle), then the number of arcs will be equal to the number of nodes minus one and every node, except the initial and final nodes, will have order two. If both of those conditions are true then the path should be hamiltonian, although correct me if I'm wrong.
It does work in Safari, although that is to be expected really considering Chrome shares the WebKit backbone.
You should also put a limit on the size of the graph, as I imagine the drawing process is of quadratic order and will get very slow as the numbers increase.
Edit: The complexity of the graph is defined by 0.5n^2 - 0.5n , so if a user enters 100 you will be trying to draw 4950 arcs, which is ridiculous.