administration.html
{% for owner in owners %}
<tr>
<td>{{owner.owner}}</td>
<td>{{owner.reference_code}}</td>
<td><button class="btn btn-outline-primary btn-sm float-end" data-id="{{ owner.id }}" data-owner="{{ owner.owner }}"
data-reference-code="{{ owner.reference_code }}" data-bs-toggle="modal" data-bs-target="#editOwnerModal">Edit</button></td>
<td> <a href="{{url_for('deleteOwner', id=owner.id)}}" class="btn btn-outline-danger btn-sm float-end">Delete</a></td>
</tr>
{% endfor %}
edit_owner.modal.html
<div class="modal fade" id="editOwnerModal" tabindex="-1" aria-labelledby="editOwnerModalLabel" aria-hidden="true">
<div class="modal-dialog">
<div class="modal-content">
<div class="modal-header">
<h5 class="modal-title" id="editOwnerModalLabel">{{ gettext('Edit Owner')}}</h5>
<button type="button" class="btn-close" data-bs-dismiss="modal" aria-label="Close"></button>
</div>
<div class="modal-body">
<form method='POST' action="{{url_for('editOwner', id=owner.id)}}">
{{ AddContentOwnerForm.csrf_token }}
<input type="hidden" name="type" value="editOwner">
<div class="input-group mb-3">
<span class="input-group-text">{{ gettext('Name')}}</span>
<input type="text" class="form-control" name="owner" value="">
</div>
<div class="input-group mb-3">
<span class="input-group-text">{{ gettext('Reference Code')}}</span>
<input type="text" class="form-control" name="reference_code" value="">
</div>
<div class="d-grid col-12 mx-auto">
<button class="btn btn-outline-secondary" type="submit">{{ gettext('Update')}}</button>
</div>
</form>
</div>
<div class="modal-footer">
<button type="button" class="btn btn-outline-primary" data-bs-dismiss="modal">{{ gettext('Close')}}</button>
</div>
</div>
</div>
</div>
I want to access owner id from administration.html to the modal.html.So that i can fill the modal form with the owner details. NO JS or AJAX please!!! Is it even possible?
New contributor
jhansi cheruku is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.