I am trying to get the parent form of the submit button. Since the ID is produced dynamically, I won't know it. I am sure there is a better way to do this so other suggestions are fine as well, but if it can be done my way I would also appreciate it.
Form:
<!--Form for sending policy reminders to users-->
<form id="sendReminderForm{{ user.id }}" method="post" action="">
<input type="hidden" name="policyId" value="{{ policy.id }}">
<input type="hidden" name="userId" value="{{ user.id }}">
<button class="btn btn-warning btn-xs"
onclick="sendReminder(event)"
type="submit">
<span class="fa fa-paper-plane"></span> Remind
</button>
</form>
JS:
// Send Policy notification to user
function sendReminder(e) {
e.preventDefault();
let data = new FormData(e.target.name.get(0));
$.ajax({ ...