Changeset - 090fb9f268a0
[Not reviewed]
0 2 0
Bradley Kuhn (bkuhn) - 9 years ago 2014-12-02 22:26:55
bkuhn@ebb.org
Larger error message when submitting bad amount.

This addition to the Javascript and text ensures a clear message to the
user of a Javascript-enabled browser that there is an issue with the
amount. Also, it prevents submission of the form until the amount is
correct.

A user with Javascript disabled can circumvent these validation steps;
however, the worst-case scenario is that they make a donation for less
than $120 that is categorized in Conservancy's internal system as a
Supporter donation, and we'll be adding internal checks to find that.
2 files changed with 12 insertions and 0 deletions:
0 comments (0 inline, 0 general)
www/conservancy/static/supporter-page.js
Show inline comments
...
 
@@ -43,12 +43,23 @@ $(document).ready(function() {
 
        if (isValid)  {
 
           input.removeClass("invalid").addClass("valid");
 
           errorElement.removeClass("form-error-show").addClass("form-error");
 
           $("#form-correction-needed").removeClass("form-error-show").addClass("form-error");
 
        }
 
        else {
 
            input.removeClass("valid").addClass("invalid");
 
            errorElement.removeClass("form-error").addClass("form-error-show");
 
        }
 
    });
 
    $("#supporter-form-submit").click(function(event){
 
	var valid = $('#amount').hasClass("valid");
 
        if (! valid) {
 
            $("#form-correction-needed").removeClass("form-error").addClass("form-error-show")
 
                                        .css("font-weight", "bold").css("font-size", "150%");
 
	    event.preventDefault();
 
        } else {
 
            $("#form-correction-needed").removeClass("form-error-show").addClass("form-error");
 
        }
 
    });
 
    /* Handle toggling of annual/monthly form selections */
 
    $('.supporter-type-selection#monthly').hide();
 
    $('#annualSelector').css("font-weight", "bold").css("font-size", "127%");
www/conservancy/static/supporter/index.html
Show inline comments
...
 
@@ -234,6 +234,7 @@ internal policies</a> are published and available for scrutiny.</p>
 
                      options to the right first.</small>
 
                      </div>
 
</form>
 
<span id="form-correction-needed" class="form-error">Please ensure all form data above is correct.</span>
 
</div>
 
</div>
 
{% endblock %}
0 comments (0 inline, 0 general)