jQuery dynamic form submit twice -
i have tried create form dynamically , submit on server, data list of $(<checkbox>)
.
$('<form>').attr("method", "post") .attr('action', '/proceed') .append(data) .submit();
the problem on server comes 2 requests: post data , without data -just empty form.
submit happens once, have tried unbind submit before.
the default action of <button />
submit form when it's clicked.
as mentioned in comment, need cancel submission before create own;
$('.activateeventbutton').on('click', function (e) { activateevents(); e.preventdefault(); // prevent submission. });
Comments
Post a Comment