I have the following html form:
<form id="editForm" method="post" action="/food/update" enctype="multipart/form-data">
<div class="form-group">
<input type="text" name="title" class="form-control">
</div>
<div class="form-group">
<button id="submitEdit" type="submit" name="submit" value="Änderungen speichern">Submit</button>
</div>
</form>
The challenge is to disable the button when the user clicks the submit button to prevent a duplicate http request. Look at my js code.
$(document).ready(function(){
$(document).on("click", "#submitEdit", function () {
$('form#editForm').submit();
$('#submitEdit').attr('disabled', true);
$('#submitEdit').html('Saving...');
});
});
It works fine on the desktop, but not in web view. In the web view application I click the button, the button text changes to "Saving..." and nothing happens. The form isn't send.
I already cleared cache on my mobile before testing.
Thank you!