I am getting refresh after executing submit button in login form

Solution 1:

On your HTML, you need to place event.preventDefault(); like this:

<form class="login_form" onsubmit="event.preventDefault(); validate();">

event.preventDefault() will stop any default behavior when submitting. In the case of submit, it is the page reload.

https://codepen.io/tunk/pen/tjGdp