asd
asd

Reputation: 138

html input working incorrectly

I have a HTML Forumlar which is processed with ajax. This means it loads the page again not to the process Forumlar. My problem is that when he submits the form by pressing enter the pointer loaded in the input field, which I do not want to. does anyone know how I can prevent this?

Upvotes: 0

Views: 35

Answers (1)

Liftoff
Liftoff

Reputation: 25392

$(function(){    
    $("#myForm input").keypress(function(e){
        if(e.keyCode == 13)
            e.preventDefault();
    });
});

Upvotes: 3

Related Questions