I am currently working on a project that involves a form containing an anchor link tag with a dynamic ID. I am utilizing this anchor link tag to submit the form via Javascript. However, I am facing difficulty in fetching the ID of the same anchor link tag, which is dynamic, and submitting it to the backend server.
Here is the form structure:
<form method="POST" action="#" id="rsmForm">
<!-- Token field-->
<input type="hidden" name="_token" id="token" value="{{ csrf_token() }}">
<a href="#demo{{$i}}" id="{{ $a['id'] }}" name="asmID" data-value="{{ $a['id'] }}" onclick="document.getElementById('rsmForm').submit();"> + ASM ({{ $a['id'] }}) </a>
</form>