I have this form that a user choose values from two dropdown menu. The options in select comes from js file and are exchange rates list. I have already created the code that sho
show graph
When the submit button is clicked, the loadDoc function runs, but before the Ajax response arrives, the form submits and a new page is loaded.
loadDoc
The new page doesn't including the event handler waiting for the Ajax response.
Don't use a submit button. Add type="button".
type="button"