I want to hide a specific picklist value(Closed
) in the field stage (having picklist values- Open
, Processing
, Closed
) the following code works fine for deleting first value.
However I am unable to delete second or third pick list value even though changing the position of id, any idea?
<apex:inputField value="{!Sales__c.Stage__c}" id="st">
<script type="text/javascript">
(function(){
var e = document.querySelectorAll('[id$="st"]')[0];
if (e && !e[0].value) {e.remove(0);}
})();
</script>