I have a form on my page and a button with id "calculate" in the form. When I press the button it will do some calculations using a function. But when I press the button it behaves like a submit button and sends the data. I don't want to send the form, I just want to calculate.
<form method="post" action="" enctype="multipart/form-data" id="form_add_data">
...
<button class="btn btn-info" id="calculate" onclick="calculate()"> Calculate </button>
...
</form>