Save form Razor

Asked

Viewed 53 times

0

How can I make my form not to sumbit the same form several times. I’m having this problem because some users are clicking save several times, not waiting for the screen update, so it is saving several duplicate records.

I found some Jquery validations but none so far helped 100%. 1º I tried to disable the button when click save, but it stopped working in the case of there being a required field I could no longer validate to enable the Save button again.

Fiddle

$('form').submit(function(){
    $(this).find('button[type=submit]').prop('disabled', true);
    return true; // return false stops the from from actually submitting.. this is only for demo purposes
});

I don’t know what’s the best solution to this problem...

  • In my codes I disable the button and enable again on the return of the request.

  • How would I get the return?

  • need all ajax request code you are doing to see how it would look

  • Worse than I don’t do the ajax request. I’m using Html.Beginform.

1 answer

1


Browser other questions tagged

You are not signed in. Login or sign up in order to post.