Within a <form>
buttons without type
defenido behave as type="submit"
. Then you need to have type="button"
.
To make it redirect to another page you can inline like this:
<form name='form' method=post action='link' enctype='multipart/form-data'>
<button type='submit'>Enviar</button>
<button type="button" onclick="window.location='http://google.com'">link</button>
</form>
or with an event headphone like this:
var btn = document.querySelector('button[type="button"]');
btn.addEventListener('click', function(){
window.location='http://google.com';
});
Having in HTML only:
<button type="button">link</button>
Place a javascript event on the button, which changes the value of
window.href
to the address you want to go to. Remember this will not cause a post.– Oralista de Sistemas