Changeset - 7fec31ce8aef
[Not reviewed]
0 2 0
Bradley Kuhn (bkuhn) - 9 years ago 2014-12-03 18:33:26
bkuhn@ebb.org
Hide t-shirt size selector when t-shirt's unwanted

Use Javascript to hide the t-shirt size selector when the the user
selects "No" for "Do you want a t-shirt?". Reshow it (and make sure
it's shown by default) for "Yes".
2 files changed with 14 insertions and 2 deletions:
0 comments (0 inline, 0 general)
www/conservancy/static/supporter-page.js
Show inline comments
...
 
@@ -33,4 +33,14 @@ $(document).ready(function() {
 
        $control.find('.toggle-content').slideDown("slow");
 
    });
 
    $(".t-shirt-size-selector").show();
 
    $('input[name=os1]:radio').change(function() {
 
        var input=$(this);
 
        var value = input.val();
 
        if (value == "Yes") {
 
            $(".t-shirt-size-selector").show();
 
        } else {
 
            $(".t-shirt-size-selector").hide();
 
        }
 
    });
 
    $('#amount').addClass("valid");
 
    $('#amount').on('input', function() {
www/conservancy/static/supporter/index.html
Show inline comments
...
 
@@ -150,4 +150,5 @@ internal policies</a> are published and available for scrutiny.</p>
 
                      <input type="radio" name="os1" value="No" />No
 
                      <br />
 
                      <span class="t-shirt-size-selector">
 
                      <label for="wantGift"><strong>T-shirt size: </strong></label>
 
                      <input type="hidden" name="on3" value="size"/>
...
 
@@ -162,5 +163,5 @@ internal policies</a> are published and available for scrutiny.</p>
 
                        <option name="os3" id="os3" value="LadiesL">Ladies' L</option>
 
                         <option name="os3" id="os3" value="LadiesXL">Ladies' XL</option>
 
                      </select><br/>
 
                      </select><br/></span>
 
                      <label for="publicAck"><strong>
 
                          Should we <a href="/sponsors#supporters">list you publicly</a> as a Conservancy Supporter? </strong></label>
...
 
@@ -203,4 +204,5 @@ internal policies</a> are published and available for scrutiny.</p>
 
                      <input type="radio" name="os1" value="No" />No
 
                      <br />
 
                      <span class="t-shirt-size-selector">
 
                      <label for="wantGift"><strong>T-shirt size: </strong></label>
 
                      <input type="hidden" name="on3" value="size"/>
...
 
@@ -215,5 +217,5 @@ internal policies</a> are published and available for scrutiny.</p>
 
                        <option name="os3" id="os3" value="LadiesL">Ladies' L</option>
 
                         <option name="os3" id="os3" value="LadiesXL">Ladies' XL</option>
 
                      </select><br/>
 
                      </select><br/></span>
 
                      <label for="publicAck"><strong>
 
                          Should we  <a href="/sponsors#supporters">list you publicly</a> as a Conservancy Supporter? </strong></label>
0 comments (0 inline, 0 general)