function readOnly(count){ }
Starting November 20, the site will be set to read-only. On December 4, 2023,
forum discussions will move to the Trailblazer Community.
+ Start a Discussion
StarhunterStarhunter 

Unable to hide '--None--' value in a picklist

I do not have jquery knowledge , but i need to implement jquery hide funcitonality to hide '--None--' value from a picklist.
I googled and found the following code:
       $("#FIELDID option[value='PICKLIST VALUE TO BE HIDDEN']").hide();
However the same piece of code is not working in my case. I tried putting this inside the ready function
j$(document).ready(function(){
              j$("#roleName option[value='']").hide();
 });
Where roleName is the inputfield id and the value is equated to null as the '--None--' picklist value shows null value with alert.
Kindly let me know the mistake I am making. 
Further I have to ensure that the hide functionality works all the time unlike the above case where(I understand) the hide function will only be fired when page loads.
 
Amit Chaudhary 8Amit Chaudhary 8
Please check below post. I hope that will help you
https://developer.salesforce.com/forums/?id=906F0000000B2qjIAC
http://www.sfdcpoint.com/salesforce/custom-picklist-in-visualforce-salesforce/

If you set the field as "required" then the --None-- choice will disappear.
One idea is arealdy posted on same. Please vote for same
https://success.salesforce.com/ideaview?id=08730000000BqEeAAK

Please check below post for solution
http://www.greytrix.com/blogs/salesforce/2014/07/09/remove-none-option-from-a-picklist-in-salesforce/