I face interesting behaviour. I have a button like this i html code:<button onclick="get_paikka()"> Hae Paikka </button>
And javascript like this:
What happens when i click is that script fetches the data from my api correctly and it comes visible in data fields. But form submits immediately after receivig data. Can i avoid that submit somehow?I would just like to fetch the data from server with the script and populate fields without submit.
I noticed that variables get zeroed at the same time.So when response comes and is put in the fields there happens submit and variables lose their values.Page back in browser and you can go to see that data was received and filled.
