diff --git a/plugins/unl_theme/scripts/JS/enhanceProfileForm.php b/plugins/unl_theme/scripts/JS/enhanceProfileForm.php index 7cc902439afab8a9c39bf1d79d5dcc030db89661..8f10d87a7e76121377dc7b176f04c0918cd90eb7 100644 --- a/plugins/unl_theme/scripts/JS/enhanceProfileForm.php +++ b/plugins/unl_theme/scripts/JS/enhanceProfileForm.php @@ -1,3 +1,4 @@ +/*<script type="text/javascript">*/ (function(){ // Edit Profile Stuff function updateLL () { @@ -52,7 +53,7 @@ color: "#1091D1" }); }); - $("form.cool fieldset input, form.cool fieldset select").wrap('<div class="element"></div>'); + $("form.cool fieldset input[type!=submit], form.cool fieldset select").wrap('<div class="element"></div>'); $("form.cool label div").each(function(){ $(this).insertAfter($(this).parent()); }); @@ -475,6 +476,25 @@ $("select[name=form_data_profile_dob_day] option[value=" + dob_day + "]").attr("selected","selected"); + WDN.log("Opt in value...... " + $("input[name=form_data_info_alumni_opt_in]").val()); + var alumniOptIn = $("input[name=form_data_info_alumni_opt_in]").val(); + $("input[name=form_data_info_alumni_opt_in]").replaceWith('<input type="checkbox" name="form_data_info_alumni_opt_in" value="yes" />'); + if (alumniOptIn == "yes"){ + $("input[name=form_data_info_alumni_opt_in]").attr("checked","checked"); + } + + function alumniCheckbox () { + if ($("select[name=form_data_profile_role]").val() == "Alumnus") { + $("input[name=form_data_info_alumni_opt_in]").parent().parent().show(); + } else { + $("input[name=form_data_info_alumni_opt_in]").parent().parent().hide(); + } + }; + + alumniCheckbox(); + + $("select[name=form_data_profile_role]").change(alumniCheckbox); + $("#formloading").remove(); $("#maincontent form.cool").show();