# HG changeset patch # User Madhusudan.C.S # Date 1289909286 -19800 # Node ID f80e1c78dcc0780d18a437052eefa111408851f7 # Parent 02593358eddc31db53d211b7cbfbd95f46fdc6bd Add javascript to submit registration form template to make sure the details are supplied only when user fills in the details. diff -r 02593358eddc -r f80e1c78dcc0 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'); + } + }); });