Skip to content

IE8 ajaxForm issue. Incorrectly collect form data #390

Closed
@monco83

Description

@monco83

I'm using ajaxForm and has no data in request.
I got around the problem code modifying:

in _formToArray function replaced

if ( els ) {
        els = $(els).get();  // convert to standard array
    }

by new code:

if (els && !/MSIE 8/.test(navigator.userAgent)) {
        els = $(els).get();  // convert to standard array
    }

Activity

toneplex

toneplex commented on Jan 31, 2014

@toneplex

I ran into the same issue with IE8 and this fixed it. Thanks @monco83

stefetom

stefetom commented on Feb 5, 2014

@stefetom

hello,
Exactly same problem for me, and same solution.
Thanks too.
Can official repository be update ?
PS. I'm french, sorry for my approximative english

pgioseffi

pgioseffi commented on Feb 5, 2014

@pgioseffi

This problem seems to be happening with other methods such as formSerialize. Maybe they're all using formToArray method inside which is the method that caused me problems in this version.

added a commit that references this issue on Feb 5, 2014

#390; fix for ie8

malsup

malsup commented on Feb 5, 2014

@malsup
Collaborator

Fixed. Sorry for the delay.

freeman983

freeman983 commented on Feb 17, 2014

@freeman983

@malsup I get same problem in IE7

ghost

ghost commented on Feb 19, 2014

@ghost

@malsup Please include the "IE 678" solution of webgal to codebase.

The current version with "IE 8 only" check breaks e.g. current release of "Contact Form 7" plugin for WordPress with IE7.

http://wordpress.org/support/topic/sending-formdata-to-server-broken-in-ie7

added a commit that references this issue on Feb 19, 2014

#390; fix old IE

Tjalle

Tjalle commented on Mar 31, 2014

@Tjalle

The fix works,
But here is a small tip for the people struggling with this.
I downloaded this code a month or so ago, and in the minified version wasn't updated yet.

So if in doubt, try the non minified code if you want to save yourself some time.

guantou

guantou commented on Apr 16, 2014

@guantou

actually, ie9 has a “Compatibility Mode”, which button after the browser address . when turn it on , ajaxform also can not post any filed prarm. may be the code need add the check of ie9 。

pokej6

pokej6 commented on Jul 24, 2014

@pokej6

In IE8, I'm having the opposite problem. I need this conversion to happen. If I comment out the regex part of the conditional the code works. Otherwise, it errors and asks me to debug.

Edit: els is of type DispHTMLFormElement

nimasmi

nimasmi commented on Dec 2, 2014

@nimasmi
Contributor

Because of this wontfix jquery bug, I get the following in IE8:

>> form.elements.length
76
>> els2.length
2
>> form.elements.concat(els2)
"Object doesn't support this property or method" // does nobody else see this?
>> $(form.elements).get().concat(els2)
{...}                                  // looks good…
>> $(form.elements).get().concat(els2).length
3                                      // huh?
>> $(form.elements).get().length
1                                      // oh - I guess this is why this ticket was opened
>> $.makeArray(form.elements).concat(els2)
{...}
>> $.makeArray(form.elements).concat(els2).length
78                                     // this has the desired effect
added a commit that references this issue on Dec 2, 2014

jquery-form#390 alternative fix for IE8

added a commit that references this issue on Feb 20, 2017

Merge pull request #446 from nimasmi/master

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

      Development

      Participants

      @malsup@toneplex@nimasmi@freeman983@pokej6

      Issue actions

        IE8 ajaxForm issue. Incorrectly collect form data · Issue #390 · jquery-form/form