From d28ffd68ca450cce1ad232351dcf934301503074 Mon Sep 17 00:00:00 2001 From: Brett Smith Date: Fri, 2 Dec 2016 12:35:19 -0500 Subject: [PATCH] supporter: HTML5 improvements to form. * Use "number" type for a better prompt. * Use new standard "min" attribute for richer validation. --- www/conservancy/static/js/supporter-page.js | 2 +- www/conservancy/static/supporter/2016-supporter-appeal.html | 6 +++--- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/www/conservancy/static/js/supporter-page.js b/www/conservancy/static/js/supporter-page.js index 37bc2f95..6a2ec7a6 100644 --- a/www/conservancy/static/js/supporter-page.js +++ b/www/conservancy/static/js/supporter-page.js @@ -117,7 +117,7 @@ $(document).ready(function() { noCommaValue = value.replace(/,/g, ""); var re = /^((\d{1,3}(,?\d{3})*?(\.\d{0,2})?)|\d+(\.\d{0,2})?)$/; var isValid = ( re.test(value) && - parseInt(noCommaValue) >= parseInt(input.attr("minimum"))); + parseInt(noCommaValue) >= parseInt(input.attr("min"))); if (isValid) { input.removeClass("invalid").addClass("valid"); errorElement.removeClass("form-error-show").addClass("form-error"); diff --git a/www/conservancy/static/supporter/2016-supporter-appeal.html b/www/conservancy/static/supporter/2016-supporter-appeal.html index b7f54c17..36b53e03 100644 --- a/www/conservancy/static/supporter/2016-supporter-appeal.html +++ b/www/conservancy/static/supporter/2016-supporter-appeal.html @@ -69,7 +69,7 @@ - + $120 is a minimum for Conservancy Supporters. Donate smaller amounts here.
@@ -138,7 +138,7 @@ - + $10/month is a minimum for Conservancy Supporters. Donate smaller amounts here.
@@ -197,7 +197,7 @@ - + $120 is a minimum for Conservancy Supporters. Donate smaller amounts here.