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
Naresh KukretiNaresh Kukreti 

Using Jquery Date Picker with VisualForce <apex:inputText/>

I am trying to use Apex inputText control to input date from user using a jquery Date Picker.

The page code and used javascript function is given below, the code seems to me working absolutely fine when I am using HTML input control but not working with Apex inputText control.
<apex:page showHeader="false" id="mypage" docType="html-5.0" controller="ControllerCalculateIncentive" sidebar="false" standardStylesheets="false">
  <html>
    <head>
     <apex:stylesheet value="{!URLFOR($Resource.styles, 'bootstrap.css')}" />
     <apex:stylesheet value="{!URLFOR($Resource.styles, 'scrum.css')}" />
     <apex:stylesheet value="{!URLFOR($Resource.styles, 'jquery-ui.css')}" />
     <apex:stylesheet value="{!URLFOR($Resource.styles, 'font-awesome.css')}" />
     <apex:includeScript value="{!URLFOR($Resource.styles, 'jquery-1.11.1.js')}"/>
     <apex:includeScript value="{!URLFOR($Resource.styles, 'bootstrap.js')}"/>
     <apex:includeScript value="{!URLFOR($Resource.styles, 'jquery.min.js')}"/>
     <apex:includeScript value="{!URLFOR($Resource.styles, 'jquery-ui.js')}"/>    
     <script type="text/javascript">
        var j$ = jQuery.noConflict();
        j$(document).ready(function(){           
           var v= '{!$Component.mypage:frm:StartDate}';
            j$(v).datepicker({
                dateFormat: 'dd-mm-yyyy',
                changeMonth: true,
                changeYear: true});

            });
     </script>
    </head>
    <body>
     <apex:form id="frm">
     <apex:inputText id="StartDate" value="{!StartDate}"  ></apex:inputText> 
     <apex:form>
    </body>
  </html>
</apex:page>

 
NagendraNagendra (Salesforce Developers) 
Hi Naresh,

Please check with the following link from stack exchange community with same question and suggested workaround. Mark this as solved if it's resolved.

Best Regards,
Nagendra.
Naresh KukretiNaresh Kukreti
Hello Nagendra ,
                  Thanks for response. I checked out the link , but still the problem is not resolved. Acutally same code is working fine with html input control but not with the apex inputtext controls.

Thanks
        
 
V V Satyanarayana MaddipatiV V Satyanarayana Maddipati
Hi Naresh,

I have replied to your question in below link, please go through it.
https://developer.salesforce.com/forums/ForumsMain?id=9060G000000Xhey