I have a requirement that seeks to remove a sharepoint dropdown option if selected and when you click the save button the option selected needs to get removed from the dropdown menu.
here's my jquery code:
$(document).ready(function(){
removeItems();
});
function removeItems() {
$("#ctl00_m_g_080195fc_7520_4906_a7d3_7f90b10d5b73_ctl00_toolBarTbl_RightRptControls_SaveButton2_ctl00_diidIOSaveItem").click(function(){
var selectedItem = $("#ctl00_m_g_080195fc_7520_4906_a7d3_7f90b10d5b73_ctl00_CustomFieldIterator1_ctl02_ctl00_ctl00_ctl04_ctl00_DropDownChoice option:selected").val();
alert(selectedItem+" is removed from the dropdown options.");
$("#ctl00_m_g_080195fc_7520_4906_a7d3_7f90b10d5b73_ctl00_CustomFieldIterator1_ctl02_ctl00_ctl00_ctl04_ctl00_DropDownChoice option:selected").remove();
});
}
this seems to work when saving the form but when I load the form again the option loads again. Anyone with help??