Click here to Skip to main content
15,892,965 members
Please Sign up or sign in to vote.
4.00/5 (1 vote)
See more:
I am using below function in a DemoScript.js file and i am getting error that dateRangePicker is not a function

C#
/*Transcendent Date Selector - chrisstormer.com DEMO Scripts for running the date range picker within the article page*/
    $(document).ready(function() {  enhancedDomReady(function(){
            $('.toggleRPpos').click(function(){
                if($('div.rangePicker').css('float') == 'left') {
                    $('div.rangePicker').css('float', 'right');
                    $('.toggleRPpos').html('Align date picker to the left');
                }
                else {
                    $('div.rangePicker').css('float', 'left');
                    $('.toggleRPpos').html('Align date picker to the right');
                }
                return false;
            });

            // create date picker by replacing out the inputs
        $('.rangePicker').html('<a href="#" class="range_prev"><span>Previous</span></a><a href="#" class="rangeDisplay"><span>Pick a Date</span></a><a href="#" class="range_next"><span>Next</span></a>').dateRangePicker({menuSet: 'pastRange'});

        });
        });
Posted

1 solution

You have written:
$('.rangePicker').html('something').dateRangePicker('something');


jQuery does not expose any method named 'dateRangePicker' in it's HTML part.
Have a look at jQuery attributes [^]here.
 
Share this answer
 
Comments
Shining Legend 3-Sep-10 0:39am    
There is another JQuery script file which has the definition of this method which takes parameters.
Sandeep Mewara 3-Sep-10 10:44am    
Then it is not correctly referenced. Thus the method is not available. Make sure the script is properly referenced.

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900