0

I have this handle on a form submit:

  $("#my_form").on("submit", function (e) {

    e.preventDefault();

    debugger;

    var data = $("#my_form").serializeAllArray(); //undefined is not a function
    var data2 = $(this).serializeAllArray();      //undefined is not a function

  )};

Why am I getting this error inside this handler (which means the form is found)? I don't understand what's going on.

Incerteza
  • 32,326
  • 47
  • 154
  • 261

2 Answers2

2

It's because the function is:

.serializeArray() instead of .serializeAllArray()

Emissary
  • 9,954
  • 8
  • 54
  • 65
Sjoerd de Wit
  • 2,353
  • 5
  • 26
  • 45
0

Use serializeArray() instead of serializeAllArray(). May be serializeAllArray method is not present in your jquery library.

Kaushick Gope
  • 154
  • 1
  • 11