I have two text field:

One normal text field that accepts numbers.

<apex:inputField value="{!FinancialAssCont.Down_Payment__c}" styleClass="form-control downpaymentAmount" onblur="checkValidQuantity(event);" />

Another field is a date Type field and on focus it opens datePicker control :

<apex:inputField value="{!FinancialAssCont.Initial_Date__c}" styleClass="form-control calendar_icon inital-date cal-text" onblur="copyInitialDate(this);" />

This is the algo of onblur event:

function checkValidQuantity(evt){


Issue on IE11: When I enter the Invalid Quantity, I get a jquery popup. But the datefield also receives the focus which opens the datePicker. So i have at a time popup as well as datPicker open. I want to hide the datePicker when popup is open.


This seems like common problem :

Can you try below :

Include the Javascript snippet mentioned below after the page tag.

<script>function setFocusOnLoad() {}</script>
<!-- further content -->
  • This is not working. – Yameen Mar 2 '15 at 11:59

I have an update on this issue:

I fixed it by doing a funny trick.

Scenario: Enter wrong value in number field textbox - which is field1. Check validation on blur event .Error Message popup ones. But datePicker also shows up.

My Fix: I added onfoucs event to numeric field and called a function hideCalander.

<apex:inputField value="{!FinancialAssCont.Down_Payment__c}" styleClass="form-control downpaymentAmount" onblur="checkValidQuantity(event);" onfocus="hideCalander();" />

function hideCalander(){

Now I modified checkValidQuantity function:

function checkValidQuantity(evt){

       //Set focus to numeric text field
       jQuery('.downpaymentAmount').focus(); // This will hide the calander

      //Set the focus back to popup button



Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.