From 7a329ebb234ad78dc2e458fb1f20af15e6ad9239 Mon Sep 17 00:00:00 2001 From: Madhusudan.C.S Date: Tue, 16 Nov 2010 17:38:06 +0530 Subject: Add javascript to submit registration form template to make sure the details are supplied only when user fills in the details. --HG-- branch : payments --- project/templates/registration/submit-registration.html | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/project/templates/registration/submit-registration.html b/project/templates/registration/submit-registration.html index 5cbe3ac..7c238b0 100644 --- a/project/templates/registration/submit-registration.html +++ b/project/templates/registration/submit-registration.html @@ -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'); + } + }); }); -- cgit