sharepoint choice field value refresh on change event

%3CLINGO-SUB%20id%3D%22lingo-sub-2545852%22%20slang%3D%22en-US%22%3Esharepoint%20choice%20field%20value%20refresh%20on%20change%20event%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-2545852%22%20slang%3D%22en-US%22%3E%3CP%3EDear%20All%2C%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EI%20have%20a%20requirement%20to%20display%20few%20choice%20field%20values%20based%20on%20value%20selected%20in%20another%20dropdown%20column.%20I%20managed%20to%20hide%20values%20which%20I%20don't%20want%20to%20display%20through%20this%3A%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3Evar%20dropdown%20%3D%20%24(%22%3Ainput%5Btitle%3D'Deployment%20Ref%20Required%20Field'%5D%22)%3B%3C%2FP%3E%3CP%3E%26nbsp%3Bdropdown2.find(%22option%5Bvalue%3D'vallue1'%5D%22).remove()%3B%3CBR%20%2F%3E%26nbsp%3B%20dropdown2.find(%22option%5Bvalue%3D'vallue2'%5D%22).remove()%3B%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3Enow%20I%20want%20to%20bring%20back%20the%20hidden%2Fremoved%20value%20back%20to%20choice%20list%20in%20another%20dropdown%20change%20event.%20I%20tried%20with%20show%20and%20append%20method%20but%20it%20is%20not%20loading%20all%20choice%20values%20again.%20below%20command%20don't%20work.%20pls%20help%20with%20correct%20script%20to%20reload%20all%20choice%20values%20again.%20Thanks!%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3Evar%20dropdown%20%3D%20%24(%22%3Ainput%5Btitle%3D'Deployment%20Ref%20Required%20Field'%5D%22)%3B%3C%2FP%3E%3CP%3Edropdown.find(%22option%5Bvalue%3D'vallue1'%5D%22).show()%3B%3C%2FP%3E%3CP%3Eor%3C%2FP%3E%3CP%3E%26nbsp%3Bdropdown.children(%22option%5Bvalue%3D'vallue1'%5D%22).show()%3B%3C%2FP%3E%3CP%3Eor%3C%2FP%3E%3CP%3E%26nbsp%3B%20dropdown.find(%22option%5Bvalue%3D'vallue1'%5D%22).append()%3B%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-LABS%20id%3D%22lingo-labs-2545852%22%20slang%3D%22en-US%22%3E%3CLINGO-LABEL%3Esharepoint%20javascript%20choice%20values%20reload%3C%2FLINGO-LABEL%3E%3C%2FLINGO-LABS%3E
New 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