﻿var IsPostAllowed = true;


// If the form is a "SafePost" class, we should take extra steps to prevent double posting.  Don't post again if it has already.
// This isn't an ideal solution: for example, if something other than jQuery.Validate halts submission we won't know here.
// We'll need a more elegant solution if we extend to pages that do their own submit halting outside of jQuery.Validate.
$(function() {
    $(".SafePost").submit(function() {
        if (IsPostAllowed) {
            IsPostAllowed = false;
            return true;
        }
        else {
            return false;
        }
    });
});