2

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){
   if(inValidQuantity){
       showJqueryPopup();
   }

}

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.

0

This seems like common problem :

Can you try below :

Include the Javascript snippet mentioned below after the page tag.

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

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(){
     jQuery('#datePicker').css("display","none");
}

Now I modified checkValidQuantity function:

function checkValidQuantity(evt){
   if(inValidQuantity){
       showJqueryPopup();

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

      //Set the focus back to popup button
      jQuery('.ui-button').focus();

   }

}

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.