jquery - stop page reload

Posted by lamrin on Stack Overflow See other posts from Stack Overflow or by lamrin
Published on 2010-01-20T05:52:36Z Indexed on 2010/04/02 0:03 UTC
Read the original article Hit count: 117

Filed under:

hi,

I have Textbox and Button(Next and Previous) displayed in Lightbox. currently my page is reloading on clicking Enter button. I dont want this to happen.

What i want is, when i click Enter button the "Next" button should be clicked without page reload which resides back of lightbox.

I used following code, but both reload and click on Next button is happening

$("input").bind('keyup', function(event){ if(event.keyCode == 13){ $("#nextbtn").trigger('click'); } event.preventDefault(); return false; });

© Stack Overflow or respective owner

Related posts about jQuery