Quantcast
Channel: Active questions tagged javascript - Stack Overflow
Viewing all articles
Browse latest Browse all 138163

Is only the front-end protection enough to prevent a few additions - with Laravel?

$
0
0

Let's say there is a button (ADD BUTTON) to add a blog. Adding is done when the user clicks on this button. But when you click the button several times, a few records are created. To prevent this, I did the method with the javascript below. Do you think this method works fully?

 $(function(){
        $('form').on('submit', function () {
            $(this).find(':submit').attr('disabled', 'true');
        })
    });

When I make this code based on id and classes, user can intervene yes. When I make this code based on ids and classes, user can intervene yes. But when I write just as above, when the user intervenes in the code, either the form submission is active and it is run in a healthy way.

$(function(){
            $('.form-prevent').on('submit', function () {
                $('.btn-prevent').attr('disabled', 'true');
            })
        });

Viewing all articles
Browse latest Browse all 138163

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>