Jquery form is not submitting

I have page with form on it, I am trying to disable the button on submit with a custom disable message on it, and submit the form after using jquery.

<form>
<input type="text" name="run"/>
<input type="submit" class="send" value="Save" data-attr-message="Sending..."/>
</form>

I have try both form submit or form[0] submit neither submits the form, I try logging the form, the form is logged correctly to console, and there are no errors in console when clicking submit.

$(document).ready(function() {
      $('.send').click(function(e) {
        e.preventDefault();
        e.stopPropagation();
        var button = $(this);
        var form = button.closest("form");
        button.prop('disabled', true);
        button.val($(this).attr('data-attr-message'));
        console.log(form); //Logs form fine
        form[0].submit();
        //  form.submit();
      });
    });
<script src="https://cdnjs.cloudflare.com/ajax/libs/jquery/3.3.1/jquery.min.js"></script>
<form>
  <input type="text" name="run" />
  <input type="submit" class="send" value="Save" data-attr-message="Sending..." />
</form>



Read more here: https://stackoverflow.com/questions/64941588/jquery-form-is-not-submitting

Content Attribution

This content was originally published by WayOfLife at Recent Questions - Stack Overflow, and is syndicated here via their RSS feed. You can read the original post over there.

%d bloggers like this: