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
RajiiiRajiii 

How to disable the date picker popup default open when page load

Hi ,

  I developed a visualforce page with date field. when i opened this page the date picker popup opened default from date field. i need to just hide this popup if i click that textbox need only open this popup..Have you any solution for this.

 

Thanks

Rajii

 

srikanth123srikanth123

The popup is being shown because by default the date field is being focussed as soon as the page is loaded. write a javascript or jquery to focus on some other element when the page loads.

Shashikant SharmaShashikant Sharma

I am pretty sure your date control is the first control on the page so focus is on it. Either replace it with second control or set defult foucs to some other control.

 

set focus from javascript like this

 

document.yourform.fieldname.focus();

Ankit AroraAnkit Arora

Avoid using javascript or JQuery as it may lead to some misbehaver. Just change the position of your date field.

 

Thanks

Ankit Arora

Blog | Facebook | Blog Page

srikanth123srikanth123

Yes chagning the position of date field will be the best option. But user experience should be given more priority. As for Javascript or jQuery, it will never misbehave unless you code it poorly.

VVKrishnaVVKrishna

Just add the below lines in your Visualforce page

 

<Script>

function setFocusOnLoad() {}

</Script>

MikePhelpsMikePhelps

Thanks @VVKrishna - your solution is simple and works perfectly for me.

SKiranSKiran

Thanks VVKrishna for the solution..This worked greatly..Just curious about how it worked..

priyank rajvanshipriyank rajvanshi
thanks #VVKrishna for ur solution.. it is now working perfectly...:)
SANJUKTA BASAK 3SANJUKTA BASAK 3
Thanks @vvKrishna for the awesome solution!!:)