Saturday, March 15, 2014

Disable date picker on Visual Force Page

Most of the time customers do not want to use the standard Salesforce date picker for various reasons.
If the first field of your VF page is a date field then as soon your page got loaded the date picker pops up. It is very irritating for end users


1) How to disable the date picker pop up on page load


<apex:page>
<!-- This is a hidden text box on your page , focus gone to this field automatically when the page loaded 
 and it suppress the Date Picker Pop up --> 
 <input type="text" id="hiddenText" style="width:0px;height:0px;border: none;background-color: #fff;background: transparent;"/>
<apex:form>
  <!-- Date Field -->
</apex:form>
</apex:page>


2) Permanent disabling of date picker , override the date picker style 


 <apex:page>
<style>
.datePicker{
                    visibility:hidden;
          }
</style>
</apex:page>

No comments:

Post a Comment