javascriptjquerysmart-wizard

How can I prevent jQuery smartWizard from moving to the next step on enter press?


I have tried this code but it is not working.

var wizardForm = $('#form');

wizardForm.on('keyup keypress', function(e) {
  var code = e.keyCode || e.which;
  if (code == 13) { 
    e.preventDefault();
    return false;
  }
});

Solution

  • This article solved my queestion:

    $(window).keydown(function(event){
        if(event.keyCode == 13) {
        event.preventDefault();
        return false;
        }
    });