Matt Kruse Calendar Popup

Discussion in 'JavaScript' started by RiderXC, Jan 16, 2008.

  1. #1
    Hey,

    I am trying to use the example off of Matts Kruse's Calendar Popup. So I copied and pasted it into a html file as follows:

    
    <HTML>
    <HEAD>
    	<TITLE>JavaScript Toolbox - Calendar Popup To Select Date</TITLE>
    	<SCRIPT type="text/javascript" src="/javascript/calendarpopup/combined-compact/CalendarPopup.js"></SCRIPT>
    	<SCRIPT type="text/javascript">
    	var cal = new CalendarPopup();
    	</SCRIPT>
    </HEAD>
    <BODY>
    
    <FORM NAME="example">
    (View Source of this page to see the example code)<br>
    
    <INPUT TYPE="text" NAME="date1" VALUE="" SIZE=25>
    <A HREF="#"
       onClick="cal.select(document.forms['example'].date1,'anchor1','MM/dd/yyyy'); return false;"
       NAME="anchor1" ID="anchor1">select</A>
    </FORM>
    
    </BODY>
    </HTML>
    
    Code (markup):
    And I'm sure the CalendarPopup.js is in the right spot I copied and pasted the path into a browser and it finds it. But when I click on select nothing pops up. I was wondering if someone could possibly give me some insight into what I'm doing wrong?

    Thanks
     
    RiderXC, Jan 16, 2008 IP
  2. rkquest

    rkquest Well-Known Member

    Messages:
    828
    Likes Received:
    23
    Best Answers:
    0
    Trophy Points:
    140
    #2
    I know you said you're sure the JS file is in the right location but still a forward-slash at the beginning of a path can screw things up a little bit.. try removing the forward slash at the beginning of the SRC here..

    
    <SCRIPT type="text/javascript" src="/javascript/calendarpopup/combined-compact/CalendarPopup.js"></SCRIPT>
    
    HTML:
    Still if that doesn't work, maybe you should attach your JS file so we can try it ourselves on our end.
     
    rkquest, Jan 16, 2008 IP
  3. Mike H.

    Mike H. Peon

    Messages:
    219
    Likes Received:
    11
    Best Answers:
    0
    Trophy Points:
    0
  4. RiderXC

    RiderXC Peon

    Messages:
    16
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #4
    Mike,

    Thanks! That's exactly what I'm looking for. Would you be able to help with a few minor modifications though?

    **Edit - disregard below this. Figured out to just comment out showHome. Thanks again Mike great script!

    I'm looking to have it in a static position on the site. It has to run inside of another scripts framework. And currently it floats over it. I tried making it display lower from top(nV) by default but didn't seem to affect anything. I did manage to make it move more to the right, from 'floatTo' Left. As I'm trying to get it centered.

    Overall it's great though, I actually separated everything into a separate .js file and used window.onload to call it.
     
    RiderXC, Jan 18, 2008 IP