Changeset - 8c3ecd347abd
[Not reviewed]
0 3 0
Bradley Kuhn (bkuhn) - 9 years ago 2014-12-04 01:42:33
bkuhn@ebb.org
Return amount to id; add id for error span.

I actually think I want amount to be id rather than a class, now that I
figured out the proper selector to find them all.

Also, the $("span", input.parent()) was buggy if there were any other
span's other than error-related ones in the supporter-form-inputs div.

Finally, ditch that <small> stuff and simply place a font-size reduction
into the CSS for the form-error-show.
3 files changed with 10 insertions and 9 deletions:
0 comments (0 inline, 0 general)
www/conservancy/static/forms.css
Show inline comments
...
 
@@ -27,2 +27,3 @@
 
    margin-left: 10px;
 
    font-size: 75%;
 
}
www/conservancy/static/supporter-page.js
Show inline comments
...
 
@@ -46,7 +46,7 @@ $(document).ready(function() {
 
    });
 
    $('.amount').addClass("valid");
 
    $('.amount').on('input', function() {
 
    $('*#amount').addClass("valid");
 
    $('*#amount').on('input', function() {
 
        var input=$(this);
 
        var value = input.val();
 
        var errorElement=$("span", input.parent());
 
        var errorElement=$("span#error", input.parent());
 
        var noCommaValue = value;
www/conservancy/static/supporter/index.html
Show inline comments
...
 
@@ -143,5 +143,5 @@ internal policies</a> are published and available for scrutiny.</p>
 
  <label for="amount"><strong>Amount:</strong> $</label>
 
  <input class="amount" type="text" name="amount" size="7" minimum="120" value="120" />
 
  <span class="form-error"><small>$120 is a minimum for Conservancy
 
  Supporters.  <a href="/donate">Donate smaller amounts here</a>.</small></span><br/>
 
  <input id="amount" type="text" name="amount" size="7" minimum="120" value="120" />
 
  <span id="error" class="form-error">$120 is a minimum for Conservancy
 
  Supporters.  <a href="/donate">Donate smaller amounts here</a>.</span><br/>
 

	
...
 
@@ -210,5 +210,5 @@ internal policies</a> are published and available for scrutiny.</p>
 
  <label for="amount"><strong>Monthly Amount:</strong> $</label>
 
  <input class="amount" type="text" name="a3" size="5" minimum="10" value="10" />
 
  <span class="form-error"><small>$10/month is a minimum for Conservancy
 
  Supporters.  <a href="/donate">Donate smaller amounts here</a>.</small></span><br/>
 
  <input id="amount" type="text" name="a3" size="5" minimum="10" value="10" />
 
  <span id="error" class="form-error">$10/month is a minimum for Conservancy
 
  Supporters.  <a href="/donate">Donate smaller amounts here</a>.</span><br/>
 
                      <label for="wantGift"><strong>Do you want to receive a t-shirt? </strong></label>
0 comments (0 inline, 0 general)