How do I prevent form from redirecting after submission?

Posted by Noor on Stack Overflow See other posts from Stack Overflow or by Noor
Published on 2010-04-14T16:16:46Z Indexed on 2010/04/14 16:23 UTC
Read the original article Hit count: 221

I have searched the site and I've found various solutions, most of them suggesting using

return false;

Problem is that I'm using this piece of code to submit the form:

$(function() {  
    $("#snd").click(function() {  
        var dendar = "http://" + $("#inpt").val() + ":" + $("#pwd").val() + "secretsite.lol/something.xml";
        $("#formen").attr("action", dendar);
        $("#formen").submit();
        alert(dendar);
        return false;
    });  
});

The alert is just there to let me know that the form has been submitted..

Thanks guys!

© Stack Overflow or respective owner

Related posts about jQuery

Related posts about forms