My goal is to prevent a link from submitting my form multiple times when clicked. I need this to avoid duplicate requests being sent by the same user. Below is the code I've tried, but unfortunately, it does not seem to be effective.
<a id="submit-form-link" onclick="document.forms[0].submit()" class="next">Next <span>Step</span></a>
<script type="text/javascript">
$('#submit-form-link').click(function(){
$('submit-form-link', this).attr('style', 'pointer-events: none;');
});
</script>
I'm getting close to making it work, but it still seems to have some issues.