diff options
| author | Guillaume Horel <guillaume.horel@gmail.com> | 2015-03-21 21:03:06 -0400 |
|---|---|---|
| committer | Guillaume Horel <guillaume.horel@gmail.com> | 2015-03-21 21:03:06 -0400 |
| commit | 61b3e2bc2b7b3b4abdd9c5738ea336dea903e90a (patch) | |
| tree | 6fbd6f61353fab2757370f259105c02e6a45813d | |
| parent | c8672196cd4f8e45667052274783a012e166923d (diff) | |
| download | wedding-website-61b3e2bc2b7b3b4abdd9c5738ea336dea903e90a.tar.gz | |
fixes
| -rw-r--r-- | static/wedding.js | 7 | ||||
| -rw-r--r-- | templates/en/rsvp.htm | 9 |
2 files changed, 10 insertions, 6 deletions
diff --git a/static/wedding.js b/static/wedding.js index 415b613..015bc83 100644 --- a/static/wedding.js +++ b/static/wedding.js @@ -26,11 +26,12 @@ $("input:radio[name=language]").change(function(){ }); $("input:radio[name=answer]").change(function(){ var state = $(this).val()=="0"; - ["email", "mailing", "plusoneyes", "plusoneno", "plusonename", "kidsyes", - "kidsno", "kidsnames"]. + ["email", "mailing", "plusoneyes", "plusoneno", "kidsyes","kidsno"]. forEach(function(id){ $("#"+id).prop("disabled",state); - }) + }); + $("#plusonename").prop("disabled", $(this).val() || $("#plusoneno").prop("checked")); + $("#kidsnames").prop("disabled", $(this).val() || $("kidsno").prop("checked")); }); $("input:radio[name=plusone]").change(function(){ $("#plusonename").prop("disabled", $(this).val()=="0"); diff --git a/templates/en/rsvp.htm b/templates/en/rsvp.htm index f258b41..5d584d0 100644 --- a/templates/en/rsvp.htm +++ b/templates/en/rsvp.htm @@ -46,7 +46,9 @@ <label for="email" class="col-md-2 control-label">Email:</label> <div class="col-md-5"> <input type="email" id="email" class="form-control" - name="email" placeholder="email" value="{{form['email'] if form['email']}}" /> + name="email" placeholder="email" + value="{{form['email'] if form['email']}}" + {% if not form['rsvp'] %}disabled{% endif %}/> </div> </div> <div class="form-group"> @@ -104,7 +106,8 @@ <div class="col-md-5"> <textarea id="kidsnames" name="kidsnames" placeholder="Your kids' names" class="form-control" rows="3" - {%if not form['kids']%} disabled{% endif %}></textarea> + {%if not form['kids']%} disabled{% endif %}>{{form['kidsnames']}} + </textarea> </div> </div> <p style="text-indent:3em"> @@ -115,7 +118,7 @@ <label for="mailing" class="col-md-2 control-label">Comments:</label> <div class="col-md-5"> <textarea id="comments" name="comments" placeholder="Your comments" - value="{{form['comments']}}" class="form-control" rows="3"></textarea> + class="form-control" rows="3">{{form['comments']}}</textarea> </div> </div> <div class="form-group"> |
