mirror of
https://github.com/GSA/notifications-admin.git
synced 2026-08-19 14:09:20 -04:00
Add hidden form to re-post AJAX requests
Serializing the search box form is bad, because the AJAX thing submit any changes that the user makes to the contents of the box. This results in unexpected behaviour.
This commit is contained in:
@@ -24,7 +24,6 @@
|
||||
method="post"
|
||||
action="{{ url_for('.view_notifications', service_id=current_service.id, message_type=message_type) }}"
|
||||
class="grid-row"
|
||||
id="search-form"
|
||||
>
|
||||
<div class="column-three-quarters">
|
||||
{{ textbox(
|
||||
@@ -34,11 +33,16 @@
|
||||
) }}
|
||||
</div>
|
||||
<div class="column-one-quarter align-button-with-textbox">
|
||||
<input type="hidden" name="csrf_token" value="{{ csrf_token() }}" />
|
||||
<input type="hidden" name="csrf_token" value="{{ csrf_token() }}">
|
||||
<input type="submit" class="button" value="Search">
|
||||
</div>
|
||||
</form>
|
||||
|
||||
<form id="search-form" method="post">
|
||||
<input type="hidden" name="to" value="{{ search_form.to.data }}">
|
||||
<input type="hidden" name="csrf_token" value="{{ csrf_token() }}">
|
||||
</form>
|
||||
|
||||
{{ ajax_block(
|
||||
partials,
|
||||
url_for('.get_notifications_as_json', service_id=current_service.id, message_type=message_type, status=status, page=page),
|
||||
|
||||
Reference in New Issue
Block a user