Alexis Alexis - 9 months ago 138
jQuery Question

TypeError: (intermediate value).apply is not a function

I am trying to submit a form with the button that is not inside the form...

<form id="updateForm">
<input type="text" name="a" />
<input type="text" name="b" />

<input type="button" class="done"/>

I have this jquery function that I tried




But... I get the error. Is there any alternatives?

Answer Source

If you just want to submit the form, that's what you should do

$(".done").click(function() {

    var form = $('#updateForm');

        url  : form.prop('action'),
        type : form.prop('method'),
        data : form.serialize()
    }).done(function(result) {