sharepoint choice field value refresh on change event

Copper Contributor

Dear All,

 

I have a requirement to display few choice field values based on value selected in another dropdown column. I managed to hide values which I don't want to display through this:

 

var dropdown = $(":input[title='Deployment Ref Required Field']");

 dropdown2.find("option[value='vallue1']").remove();
  dropdown2.find("option[value='vallue2']").remove();

 

now I want to bring back the hidden/removed value back to choice list in another dropdown change event. I tried with show and append method but it is not loading all choice values again. below command don't work. pls help with correct script to reload all choice values again. Thanks!

 

var dropdown = $(":input[title='Deployment Ref Required Field']");

dropdown.find("option[value='vallue1']").show();

or

 dropdown.children("option[value='vallue1']").show();

or

  dropdown.find("option[value='vallue1']").append();

 

 

0 Replies