Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7873401
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 3, 20262026-06-03T02:30:12+00:00 2026-06-03T02:30:12+00:00

I am getting no date picker in my web page but in fiddle it

  • 0

I am getting no date picker in my web page but in fiddle it is coming, what i am missing?

http://jsfiddle.net/cBwEK/

It is coming fine in fiddle but i am getting nothing in my web page. I
have written below scripts

The whole source code is here: http://www.monkeyphysics.com/mootools/script/2/datepicker

<html>
 <head>
    <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
    <title>JSP Page</title>     
    <script type="text/javascript" src="datepicker.js"></script>      
    <script type="text/javascript" src="mootools-yui-compressed.js"></script>
    <script type="text/css" src="datepicker.css"></script>        
    <script type="text/javascript">           
        new DatePicker('.picker', {
            pickerClass: 'datepicker ',
            allowEmpty: true
        });           
    </script>        
 </head>
 <body>
     <label>Datepicker starting at and allowing no value:</label>
     <input name='date_allow_empty' type='text' value='' class='date picker' />
 </body>
</html>
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-03T02:30:13+00:00Added an answer on June 3, 2026 at 2:30 am

    You need to run your JavaScript code after the relevant elements exist in the DOM. Just move the script to the end of the page. Also, if the date picker script relies on MooTools, you need to put the datepicker include after the MooTools include. E.g.:

    <html>
     <head>
        <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
        <title>JSP Page</title>     
        <!-- FIRST CHANGE HERE, swapping the order of the script elements -->
        <script type="text/javascript" src="mootools-yui-compressed.js"></script>
        <script type="text/javascript" src="datepicker.js"></script>      
        <link type="text/css" rel="stylesheet" href="datepicker.css">
     </head>
      <body>
       <label>Datepicker starting at and allowing no value:</label>
       <input name='date_allow_empty' type='text' value='' class='date picker' />
       <!-- SECOND CHANGE HERE, moving your script to *after* the elements it operates on -->
       <script type="text/javascript">           
                new DatePicker('.picker', {
         pickerClass: 'datepicker ',
         allowEmpty: true
         });           
       </script>        
      </body>
    </html>
    

    Live copy | source

    There I’ve just moved your script, but you might move all the scripts down there as the YUI people suggest.

    The reason it works in jsFiddle is that you have the fiddle set to load the JavaScript code from the onload event, which happens very late in the process; the DOM elements are there by then.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

i am working on a project where i am getting date value from date-picker
I used Date() for getting the date of my birthday, but it was returned
I'm getting a date from a Web Service, dd/mm/yyyy hh:mi:ss. Like this: 10/10/2011 12:00:00
I am using one jquery date picker, with using picker i am getting date
I've searched for a free and good Date picker out there but I didn't
I am trying to understand UiActionSheet with a Date Picker. Getting 2 warnings that
I have implemented jquery date picker, but I'm struggling with parsing datetime value. Scenario
I'm using OLEDB to query an excel file using date time picker but I
I m using date picker in my project and I m getting selected date
My iphone application having the Date Picker option. It is working fine in 3GS

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.