+ Start a Discussion
suneel raosuneel rao 

How to remove default None form the picklist field in custom vfpage

Hi eveyone,
I want to remove the default '--None--' value form the picklist field in my custom vfpage. I have used the script to remove none form the picklist filed.
<script type='text/javascript' src= '//ajax.googleapis.com/ajax/libs/jquery/1.6.2/jquery.min.js'>
        </script>
        <script language="javascript">
            $(function() {       
                $('select.RemoveNone option[value=]').remove();    
                  $(".usstates").hide(); 
                  
            });
        </script>

But it's not removing for custom fields. Can any one help me over here.

regards,
Suneel.
Sergio AlcocerSergio Alcocer
Doesn't it help to make the input required?

Marking best answers is good for all people.
  • Other users with same question: will be easier to find the right answer without having to go through all of the conversation
  • Other users that knows the answer: saving time before they realise its already answered properly
  • Author: makes him/her happy
Vipin PVipin P
If you set a defult value to pick list you can remove none. Other wise as suggested in the above post, if you can make the filed required.