campaign: select monthly in js
authorKai Michaelis <kai@gnupg.org>
Wed, 17 May 2017 14:37:04 +0000 (16:37 +0200)
committerKai Michaelis <kai@gnupg.org>
Wed, 17 May 2017 14:37:16 +0000 (16:37 +0200)
web/donate/donate.org
web/share/campaign/campaign.js

index 0970631..0190524 100644 (file)
       <div class="form-group">
         <label for="recur" class="col-md-2 control-label">Recurring</label>
         <div class="col-md-2">
-          <select class="form-control" name="recur">
+          <select class="form-control" name="recur" id="recur">
             <option value="0"
             selected="selected"><!--RECUR_NONE-->Just once</option>
             <option value="12" ><!--RECUR_MONTH-->Monthly</option>
index e06d356..a2ccfcc 100644 (file)
@@ -62,9 +62,13 @@ $(document).ready(function() {
   let vals = ["500", "200", "100", "50", "20", "10", "5"];
 
   for (let value of vals) {
-    $(".amount-btn-" + value.toString()).attr("href","#");
-    $(".amount-btn-" + value.toString()).one("click",function() {
-      $("#amountother").attr("value",value.toString());
+    $(".amount-btn-" + value.toString()).attr("href", "#");
+    $(".amount-btn-" + value.toString()).one("click", function() {
+      $("#amountother").attr("value", value.toString());
+      $("#currency option").attr("selected", false);
+      $("#currency option[value='EUR']").attr("selected", true);
+      $("#recur option").attr("selected", false);
+      $("#recur option[value='12']").attr("selected", true);
     });
   }
 });