I have Textboxboth Button(Next and Previous) displayed in Lightbox. My page is currently reloading after pressing the Enter key. I do not want this to happen.
What I want, when I press the Enter key, I should click the "Next" button without reloading the page that is back in the lightbox.
I used the following code, but it occurs as reloadwell as clickthe following buttons:
$("input").bind('keyup', function(event){
if(event.keyCode == 13){
$("#nextbtn").trigger('click');
}
event.preventDefault();
return false;
});
source
share