Skip to content

Commit

Permalink
Added double-post prevention
Browse files Browse the repository at this point in the history
  • Loading branch information
JoshuaCarroll committed Jan 23, 2019
1 parent 69157ad commit cd40c1a
Show file tree
Hide file tree
Showing 5 changed files with 11 additions and 5 deletions.
2 changes: 1 addition & 1 deletion LoginRequest.aspx
Expand Up @@ -31,7 +31,7 @@
<asp:HiddenField ID="hdnState" runat="server" />
<asp:HiddenField ID="hdnZip" runat="server" />
<br />
<asp:Button ID="btnSubmit" runat="server" Text="Submit" OnClick="btnSubmit_Click" />
<asp:Button ID="btnSubmit" runat="server" Text="Submit" CssClass="noDoubleClick" OnClick="btnSubmit_Click" />
</section>
</asp:Content>

2 changes: 1 addition & 1 deletion LoginReset.aspx
Expand Up @@ -14,7 +14,7 @@
<asp:RegularExpressionValidator ID="RegularExpressionValidator1" runat="server" ErrorMessage="That is not a valid US call sign." ValidationExpression="[AKNWaknw][a-zA-Z]{0,2}[0123456789][a-zA-Z]{1,3}" ControlToValidate="txtCallsign">*</asp:RegularExpressionValidator>
<asp:RequiredFieldValidator ID="RequiredFieldValidator1" runat="server" ErrorMessage="Callsign is required." ControlToValidate="txtCallsign">*</asp:RequiredFieldValidator>
<br />
<asp:Button ID="btnSubmit" runat="server" Text="Submit" OnClick="btnSubmit_Click" />
<asp:Button ID="btnSubmit" runat="server" Text="Submit" CssClass="noDoubleClick" OnClick="btnSubmit_Click" />
</section>
</asp:Panel>
<asp:Panel ID="pnlAfter" runat="server" Visible="false">
Expand Down
2 changes: 0 additions & 2 deletions LoginReset.aspx.cs
Expand Up @@ -61,8 +61,6 @@ protected void btnSubmit_Click(object sender, EventArgs e)
pnlAfter.Visible = true;
lblDirections.Text = "An error occurred while processing your reset request. We have logged this error. In the meantime you are welcome to browse to the home page, then back here to try again.";
}
btnSubmit.Enabled = false;
txtCallsign.Enabled = false;
}
}
}
8 changes: 8 additions & 0 deletions MasterPage.master
Expand Up @@ -53,5 +53,13 @@
</footer>
</div>
</form>
<script>
$('.noDoubleClick').click(function () {
$('.noDoubleClick').prop('disabled', true);
setTimeout(function () {
$('.noDoubleClick').prop('disabled', false);
}, 2000);
});
</script>
</body>
</html>
2 changes: 1 addition & 1 deletion request/Default.aspx
Expand Up @@ -72,7 +72,7 @@
<br />
Please keep in mind that the frequencies listed are those that our database show to be available - there may be someone using a frequency that is not coordinated. Please monitor the desired frequency before submitting your request.<br />
<br />
<div class="center"><asp:Button ID="btnNext" runat="server" Text="Next" OnClick="btnNext_Click" /><asp:Button ID="btnSubmit" runat="server" Text="Submit" Visible="false" OnClick="btnSubmit_Click" />
<div class="center"><asp:Button ID="btnNext" runat="server" Text="Next" OnClick="btnNext_Click" CssClass="noDoubleClick" /><asp:Button ID="btnSubmit" runat="server" Text="Submit" Visible="false" OnClick="btnSubmit_Click" CssClass="noDoubleClick" />
&nbsp;<asp:Button ID="btnCancel" runat="server" Text="Cancel" OnClick="btnCancel_Click" /></div>
<br />
</section>
Expand Down

0 comments on commit cd40c1a

Please sign in to comment.