Why would a button click event cause site to reload in a Bootstrap form?

A <button> tag uses Submit behavior by default. Thus your page submits the form when the button is clicked and this looks like a page refresh itself. To work around this you can either use an input tag

<input type="button" class="btn btn-primary btnSeccion" id="btnSeccion3" value="Continuar"/>

to do the same effect. Or you can cancel the Submit in your button’s click Event Handler (if that’s what you want) like this:

$(".btnSeccion").click(function(event) {
    btnMostrarSeccion($(this));
    event.preventDefault();
})

Leave a Comment

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)