Add javascript to submit registration form template to make sure the details are supplied only when user fills in the details. payments
authorMadhusudan.C.S <madhusudancs@gmail.com>
Tue, 16 Nov 2010 17:38:06 +0530
branchpayments
changeset 264 f80e1c78dcc0
parent 263 02593358eddc
child 265 4b40c44d9f2d
Add javascript to submit registration form template to make sure the details are supplied only when user fills in the details.
project/templates/registration/submit-registration.html
--- a/project/templates/registration/submit-registration.html	Tue Nov 16 17:37:36 2010 +0530
+++ b/project/templates/registration/submit-registration.html	Tue Nov 16 17:38:06 2010 +0530
@@ -19,6 +19,20 @@
         $('#id_sex').removeAttr('disabled');
       }
     });
+
+    if (!$('#id_paid').is(':checked')) {
+        $('#id_type').attr('disabled', 'disabled');
+        $('#id_details').attr('disabled', 'disabled');
+      }
+      $('#id_paid').change(function() {
+        if (!$('#id_paid').is(':checked')) {
+          $('#id_type').attr('disabled', 'disabled');
+          $('#id_details').attr('disabled', 'disabled');
+        } else {
+          $('#id_type').removeAttr('disabled');
+          $('#id_details').removeAttr('disabled');
+        }
+      });
   });