jQuery override form submit not working when submit called by javascript on a element

A couple of suggestions:

  • Overwrite the submit function to do your evil bidding

    var oldSubmit = form.submit;
    form.submit = function() {
        $(form).trigger("submit");
        oldSubmit.call(form, arguments);
    }
  • Why not bind to all the <a> tags? Then you don’t have to do any monkey patching, and it could be as simple as (assuming all the links are inside the form tag):

    $("form a").click(function() {
        $(this).parents().filter("form").trigger("submit");
    });

Leave a Comment

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)