Bug Tracker

Opened 13 years ago

Closed 13 years ago

Last modified 8 years ago

#1023 closed bug (worksforme)

IE6: $(form).submit() doesn't trigger attached events by $(form).ajaxForm()

Reported by: arikon Owned by:
Priority: critical Milestone: 1.1.3
Component: ajax Version: 1.1.2
Keywords: Cc:
Blocked by: Blocking:

Description

I'm using this to submit form via ajax request:

$('#news-form').ajaxForm(formOptions);

I have also another two events attached to form submit event:

$('#news-form').submit(function() {
    alert(123);
});
$('#news-form').submit(function() {
    alert(456);
});

I have buttons in my app with attached events, where I call:

$('#news-form').submit();

But, when I press this buttons, there is no ajax request performed and no other events triggered

Change History (3)

comment:1 in reply to:  description Changed 13 years ago by arikon

Some addition. Thats all works fine in FF 2.0.0.2, but doesn't work in IE6.

comment:2 Changed 13 years ago by malsup

I had no problems getting this scenario working in IE6. I used the following code:

<html>
<head>
<script src="jquery-1.1.2.js"></script>
<script src="jquery.form.js"></script>
<script type="text/javascript">
$(function() {
    $('form').ajaxForm(function(r) {
        alert(r);
    });
    $('form').submit(function() {
        alert('1');
    });
    $('form').submit(function() {
        alert('2');
    });
    $('button').click(function() {
        $('form').submit();
    });
});
</script>
</head>
<body><div>
    <form action="march7.txt">
        <input type="text" name="name" />
        <input type="submit" />
    </form>
    <button>Test</button>
</div></body>
</html>

comment:3 Changed 13 years ago by john

need: Review
Resolution: worksforme
Status: newclosed

It appears as if Mike has confirmed that this works; marking as "worksforme".

Note: See TracTickets for help on using tickets.