简体   繁体   中英

dynamic javascript date picker

I have a script for dynamic javascript date picker, taken from here . Please scroll down to Toggle by Element which i want to implement but it is not working

<html>
 <head>
    <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
    <title>JSP Page</title>
     <SCRIPT type="text/javascript" src="js/jquery.min.js"></SCRIPT>

edit: i added the following mootools script

<script src='http://cdnjs.cloudflare.com/ajax/libs/mootools/1.3.2/mootools-yui-
compressed.js'
type='text/javascript'></script>


      <SCRIPT type="text/javascript" src="datepicker.js"></SCRIPT>
      <SCRIPT type="text/css" src="datepicker.css"></SCRIPT>
      <SCRIPT type="text/css" src="datepicker_vista.css"></SCRIPT>
</head>
 <body>    
 <script language="JavaScript">
   window.addEvent('load', function() {
    new DatePicker('.demo_allow_empty', {
    pickerClass: 'datepicker_dashboard',
    allowEmpty: true
 });
  });
 </script>
<label>Datepicker starting at and allowing no value:</label>
<input name='date_allow_empty' type='text' value='' class='date demo_allow_empty' />
</body>
</html>

what i am missing?

It seems it require mootools, i cant see any mootools script tag in your source. it has nothing to do with jQuery.

edit: here is an exemple:

<script src='http://cdnjs.cloudflare.com/ajax/libs/mootools/1.3.2/mootools-yui-compressed.js'
type='text/javascript'></script>

put it before the date picker script

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM