I have an issue while using buttons inside form. I want that button to call function. It does, but with unwanted result that it refresh the page.
My simple code goes
Add type="button" to the button.
type="button"
Click
The default value of type for a button is submit, which self posts the form in your case and makes it look like a refresh.
type
submit