Save form Razor

0

How can I make for my form not to do sumbit of the same form several times. I'm having this problem because some users are clicking save multiple times, not waiting for the update screen, so then you are saving multiple duplicate records.

I found some JQuery validations but none so far helped 100%. 1st I tried to disable the button when I click save, but it stopped working in case If there is a required field I could not validate again 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 do not know the best solution to this problem ...

    
asked by anonymous 30.05.2018 / 22:25

1 answer

1

Hello,

There are several ways to handle this, I would recommend that you make a jquery function that will clean your form by clicking the save button, but this would be effective if the validation of your form is done entirely from the client side. / p>

Another solution is to use a jquery plugin that does this, like this link here: link

    
30.05.2018 / 23:16