On 3/22/2009 2:08 PM, !oEL wrote:
> First of all, thank you for your time to moderate my first post.
> 
> Here is the complete (yet minimal) code snippet which indicates all
> the dependencies (I've downloaded from prototype official site and the
> authoer's site: http://home.jongsma.org/software/js/datepicker):
> 
> -- code start --
> 
> <html>
> <head>
> <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
> <title>Calendar Example</title>
> 
> <script src="js/lib/prototype.js" type="text/javascript"></script>
> <script src="js/lib/prototype-base-extensions.js" type="text/
> javascript"></script>
> <script src="js/lib/prototype-date-extensions.js" type="text/
> javascript"></script>
> <script src="js/src/scriptaculous.js" type="text/javascript"></script>
> <script src="js/controls/datepicker.js" type="text/javascript"></
> script>
> 
> <link rel="stylesheet" rev="stylesheet" href="style/datepicker.css"
> type="text/css" media="all" />
> 
> <script type="text/javascript">
> new Control.DatePicker('my_datepicker', {icon: 'style/calendar.png'});
> </script>
> </head>
> 
> <body>
> <input type="text" id="my_datepicker" />
> </body>
> 
> -- code end --

The input hasn't been created by the time the javascript is called.  You
either need to move the code:

new Control.DatePicker(....)

to below the <input> or wrap it in a function that gets called at page
load.  Something like this:

window.observe('dom:loaded', function() {new Control.DatePicker(...)});

--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"Prototype & script.aculo.us" group.
To post to this group, send email to prototype-scriptaculous@googlegroups.com
To unsubscribe from this group, send email to 
prototype-scriptaculous+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/prototype-scriptaculous?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to