aboutsummaryrefslogtreecommitdiffstats
path: root/static
diff options
context:
space:
mode:
authorGuillaume Horel <guillaume.horel@gmail.com>2015-03-21 20:24:30 -0400
committerGuillaume Horel <guillaume.horel@gmail.com>2015-03-21 20:24:30 -0400
commitcd2706b1a432f1b5641fd24212d1b0b0a55e17ab (patch)
treefdcb4aa12bc4c9a4fd23896854faf6f632e2df7b /static
parentfc0203fd66be5b9003e8a6a362a0811dea7d743a (diff)
downloadwedding-website-cd2706b1a432f1b5641fd24212d1b0b0a55e17ab.tar.gz
disable some elements depending on the answer
Diffstat (limited to 'static')
-rw-r--r--static/wedding.js14
1 files changed, 14 insertions, 0 deletions
diff --git a/static/wedding.js b/static/wedding.js
index 9e2f220..415b613 100644
--- a/static/wedding.js
+++ b/static/wedding.js
@@ -24,3 +24,17 @@ $("input:radio[name=language]").change(function(){
$("button[name=login]").text("Login");
}
});
+$("input:radio[name=answer]").change(function(){
+ var state = $(this).val()=="0";
+ ["email", "mailing", "plusoneyes", "plusoneno", "plusonename", "kidsyes",
+ "kidsno", "kidsnames"].
+ forEach(function(id){
+ $("#"+id).prop("disabled",state);
+ })
+});
+$("input:radio[name=plusone]").change(function(){
+ $("#plusonename").prop("disabled", $(this).val()=="0");
+});
+$("input:radio[name=kids]").change(function(){
+ $("#kidsnames").prop("disabled", $(this).val()=="0");
+});