You need to sign in to do that
Don't have an account?
Starhunter
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.
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.
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/