0

I have used the below code for the compatibility of browsers for displaying the date picker and its working fine

<script src="//cdn.jsdelivr.net/webshim/1.14.5/polyfiller.js"></script>
<script>
    webshims.setOptions('forms-ext', {types: 'date'});
webshims.polyfill('forms forms-ext');
</script>
<input type="date" value="From" id="DateFrom"/> 
<input type="date"  value="To" id="DateTo"/> 
<input type="button" onclick="Search();" value="Search"/> 



    <script>
    function Search(){
        var fromdate = document.getElementById("DateFrom").value;
        var todate = document.getElementById("DateTo").value;
        alert('Date:::  ' +fromdate);
        ActionFuc(fromdate,todate);
    }

</script>

I have used this link cdn.jsdelivr.net/webshim/1.14.5/polyfiller.js and saved the javascript and used it in static resource.

By using static resource in visualforce page its not displaying the datepicker.

<apex:includeScript value="{!$Resource.DateSearch}"/>
<script>
    webshims.setOptions('forms-ext', {types: 'date'});
webshims.polyfill('forms forms-ext');
</script>

Please suggest.

Thanks in advance

3
  • The file name is case sensitive, you can recheck path and file name.
    – MIX DML
    Feb 9, 2016 at 10:40
  • can you check developer console in chrome? Probably, there are invalid JS, or you make zip file and put it inside, or something else. Just check if that is loaded
    – kurunve
    Feb 9, 2016 at 10:40
  • Not easy to tell from the minified polyfiller.js, but I would expect that it loads other JavaScript when you set various options, so as kurunve suggests check your browser for load errors and perhaps include the multiple JavaScript files in a ZIP file static resource.
    – Keith C
    Feb 9, 2016 at 12:49

0

You must log in to answer this question.

Browse other questions tagged .