I have choice field called status, default is set to a value submitted. It has the following values. Save Submitted Rejected Approved

if save or submitted is selected the other two should be hidden. I have tried the below code.

    <script src="https://ajax.googleapis.com/ajax/libs/jquery/1.12.4/jquery.min.js"></script>

//Show/hide columns based on Choice Field Selection
 var status = $("input[name='ctl00$ctl38$g_affa1499_f8c3_4242_bbb3_57110a81fc84$ctl00$ctl05$ctl12$ctl00$ctl00$ctl04$ctl00$RadioButtons']:checked").val();

if ($("select[title='Submitted']").val() != "Yes" || $("select[title='Submitted']").val() != '' )


its not working.

  • at which line error occurred ? – Gopal Zadafiya Jul 18 '18 at 12:05
  • there was no error its just not hiding as needed – Rinu Jul 18 '18 at 15:16
  • Does the alert ever trigger? You might try adding looking in the browser dev tool and seeing if your styles are being applied correctly? – MickB Jul 18 '18 at 21:24

Using F12 to check the radio button elements, we will find the values of the radio buttons are ctl00, ctl01, ctl02.... Please use F12 check your exact radio button values. enter image description here

Then use this script:

<script src="https://code.jquery.com/jquery-1.10.2.min.js" type="text/javascript"></script>

<script language="javascript" type="text/javascript">

//In my “status” column, button values: Save-"ctl00" Submitted-"ctl01" Rejected-"ctl02" Approved-"ct103"

function hideOrShowOptions(){

                  var status = $("input[name$='ctl00$RadioButtons']:checked").val();


                  if(status == "ctl00" || status == "ctl01"){



                  } else {





$(document).ready( function() {







Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.