Link redirect not working in Firefox

Asked

Viewed 57 times

1

Well, I’m in the final stretch of developing a website, and a problem has arisen with the browser Firefox, in all others browsers tested, a link inside a button worked, however, on firefox, it reads the cancel/back button as a submit, but he’s there just as a simple type="button"

I was wondering if there’s any way that with javascript or Jquery, I can solve the problem.

*Tested browsers [Chrome, Firefox, Opera, Safari Windows, Safari IOS, IE9+]

1 answer

2


You can do so, when your #form receives a Ubmit, you disable it and perform your action, which in case would be back/cancel.

With that return false; Submit will no longer have any action.

$('#form').submit(function() {
    // sua ação.
    return false;
});

Hugs! =)

  • but I don’t want to disable Submit, I just want the back button to act as a link, for example, if the user got confused with the page, filled in some information, it could go back to the desired page, I tested the function, and it disabled the Submit button but not the back

  • 1

    Got it. Another method to make a "back" button would be without the type="button" and the button in an "a" modeled with CSS. For example: <a href="http://www.stackoverflow.com/" class="btn-voltar">Voltar</a>

  • I did it but it doesn’t work, ta button reading as Submit

Browser other questions tagged

You are not signed in. Login or sign up in order to post.