I have two drop-down fields with names which I will use to control the routing of the form (.formersup and .hiringmgr). Only one of the routing fields should show on the form based on the type of change being requested (.changeaction) and if the current supervisor (.currentsup) and proposed supervisor (.proposedsup) fields do not have the same value. I was able to control the display of the routing drop-down fields based solely on the type of change being requested, but when I tried to add the comparison of the two supervisor fields the JS broke. Can someone help me fix my JS to get it to work properly? Below is the JS that does not work and attached is a snapshot of the form. Any help is greatly appreciated.
$(document).ready(function() { $('.changeaction').click|| $('.currentsup input, .proposedsup input').change (function(){ if($('input[value="Demotion"]').is(':checked')|| $('input[value="Promotion"]').is(':checked')|| $('input[value="Transfer"]').is(':checked')|| $('input[value="Supervisor_Change"]').is(':checked')&& $('.currentsup input').val() !== $('.proposedsup input').val()) { $('.formersup').show(); $('.hiringmgr').hide(); } else { $('.hiringmgr').show(); $('.formersup').hide(); } }); });