Bug Tracker

Modify

Ticket #1023 (closed bug: worksforme)

Opened 6 years ago

Last modified 14 months ago

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:
Blocking: Blocked by:

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

comment:1 in reply to: ↑ description Changed 6 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 6 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 6 years ago by john

  • need set to Review
  • Status changed from new to closed
  • Resolution set to worksforme

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

Please follow the  bug reporting guidlines and use  jsFiddle when providing test cases and demonstrations instead of pasting the code in the ticket.

View

Add a comment

Modify Ticket

Action
as closed
Author


E-mail address and user name can be saved in the Preferences.

 
Note: See TracTickets for help on using tickets.