CodingForums.com

CodingForums.com (http://www.codingforums.com/index.php)
-   JavaScript frameworks (http://www.codingforums.com/forumdisplay.php?f=62)
-   -   is not a function (http://www.codingforums.com/showthread.php?t=286622)

jarv 01-29-2013 10:42 AM

is not a function
 
Please help,

I am using this MooTools datepicker: http://www.styledisplay.com/mootoolsdatepicker/ but with the latest MooTools version: MooTools 1.4.5

I click on my textbox and select a date but the calendar stays on the screen and I cannot see my submit button.

my FireFox console gave the following error:

TypeError: dp.container.remove is not a function

else if (dp.container) dp.container.remove();


here is the relevant Javascript code:
Code:


/* Remove the calendar from the page */
        remove: function(dp){
                $clear(dp.interval);
                dp.active = false;
                if (window.opera) dp.container.empty();
                else if (dp.container) dp.container.remove();
                dp.calendar = false;
                dp.container = false;
                $$('select.dp_hide').removeClass('dp_hide');
        }


xelawho 01-29-2013 04:32 PM

I know nothing about MooTools, but should this have two $$
Code:

$$('select.dp_hide').removeClass('dp_hide');
?

jarv 01-30-2013 09:07 AM

thanks but that didn't work

Old Pedant 01-31-2013 12:54 AM

I don't use mootools, either. But reading their documentation, I indeed see the method empty( ) noted:
http://mootools.net/docs/core/Elemen...#Element:empty

But I do *NOT* see any method named remove( ).

Perhaps you meant destroy( )?
http://mootools.net/docs/core/Elemen...lement:destroy

In any case, perhaps reading that documentation would help?


All times are GMT +1. The time now is 10:35 AM.

Powered by vBulletin®
Copyright ©2000 - 2013, Jelsoft Enterprises Ltd.