Skip to content

Commit

Permalink
Merge pull request #328 from CityOfNewYork/hotfix/OP-1415
Browse files Browse the repository at this point in the history
Hotfix/OP-1415: Pressing Enter multiple times creates multiple requests
  • Loading branch information
joelbcastillo authored Apr 5, 2018
2 parents 492e06f + 15a577f commit 5afea1e
Show file tree
Hide file tree
Showing 4 changed files with 16 additions and 4 deletions.
2 changes: 1 addition & 1 deletion app/request/forms.py
Original file line number Diff line number Diff line change
Expand Up @@ -149,7 +149,7 @@ class AnonymousRequestForm(Form):
# Request Information
request_category = SelectField('Category (optional)', choices=CATEGORIES)
request_agency = SelectField('Agency (required)', choices=None)
request_title = TextAreaField('Request Title (required)')
request_title = StringField('Request Title (required)')
request_description = TextAreaField('Request Description (required)')

# Personal Information
Expand Down
6 changes: 5 additions & 1 deletion app/static/js/request/new-request-agency.js
Original file line number Diff line number Diff line change
Expand Up @@ -208,7 +208,11 @@ $(document).ready(function () {
});

// Disable submit button on form submission
$('#request-form').submit(function() {
$('#request-form').submit(function () {
// Prevent multiple submissions
$(this).submit(function () {
return false;
});
$('#submit').hide();
$('#processing-submission').show()
});
Expand Down
6 changes: 5 additions & 1 deletion app/static/js/request/new-request-anon.js
Original file line number Diff line number Diff line change
Expand Up @@ -221,7 +221,11 @@ $(document).ready(function () {
});

// Disable submit button on form submission
$('#request-form').submit(function() {
$('#request-form').submit(function () {
// Prevent multiple submissions
$(this).submit(function () {
return false;
});
$('#submit').hide();
$('#processing-submission').show()
});
Expand Down
6 changes: 5 additions & 1 deletion app/static/js/request/new-request-user.js
Original file line number Diff line number Diff line change
Expand Up @@ -114,7 +114,11 @@ $(document).ready(function () {
});

// Disable submit button on form submission
$('#request-form').submit(function() {
$('#request-form').submit(function () {
// Prevent multiple submissions
$(this).submit(function () {
return false;
});
$('#submit').hide();
$('#processing-submission').show()
});
Expand Down

0 comments on commit 5afea1e

Please sign in to comment.