Pop Calendar/Date Picker

Batch, ASP, JScript, Kixtart, etc.
Forum rules
Do not post any licensing information in this forum.

Any code longer than three lines should be added as code using the 'Select Code' dropdown menu or attached as a file.
Locked
User avatar
jwestan
Posts: 48
Joined: Wed Mar 18, 2009 2:48 am

Pop Calendar/Date Picker

Post by jwestan » Sun Apr 05, 2009 9:06 am

Anyone have any suggestions or examples of how to create a pop up calendar in a HTA? I have seen different examples but those were mostly for ASP and I did not know how well they would port over to the HTA.

Thanks

User avatar
jwestan
Posts: 48
Joined: Wed Mar 18, 2009 2:48 am

Pop Calendar/Date Picker

Post by jwestan » Sun Apr 05, 2009 9:06 am

Anyone have any suggestions or examples of how to create a pop up calendar in a HTA? I have seen different examples but those were mostly for ASP and I did not know how well they would port over to the HTA.

Thanks

User avatar
jhicks
Posts: 1789
Joined: Sun Jan 21, 2007 11:31 pm

Pop Calendar/Date Picker

Post by jhicks » Sun Apr 05, 2009 9:37 am

Porting likely depends on the calendar complexity. You should be able to grab the script code and plug that into you HTA. You'll probably need a few tweaks. Give it a shot and we'll help you along.

User avatar
jvierra
Posts: 13736
Joined: Tue May 22, 2007 9:57 am
Contact:

Pop Calendar/Date Picker

Post by jvierra » Sun Apr 05, 2009 11:46 am

Here is about the simplest date picker you can do with an HTA that will work under all circumsances.

There are otehrs that are based on complex JavaScript code and numerous images and external files. The following needs nothing external, doesn't require any complex coding skill, is fast and is complete free of external files.

Code: Select all

<html>
    <head>
    <title>calendar</title>
    <hta:application
         scroll="no"
         singleinstance="no"
         windowstate="normal"
    >
    
</head>
<script type="text/vbscript">
    Sub cal1_click()
        ddate.value=cal1.value 
        div1.style.visibility="hidden"
    End Sub
</script>
<body>
<div>
<input id="ddate" type="text" value="click here" onclick="div1.style.visibility='visible'">
<div id="div1" style="visibility:hidden;">
    <object id="cal1" 
            classid="clsid:8E27C92B-1264-101C-8A2F-040224009C02">
    </object>
</div>
</div>
</body>
</html>


This link should demo the script. http://www.sapien.com/forums/uploads/24 ... st.hta.txt

You may get a query to ru MSCAl.OCX. You will not get this when saved to an HTA and allowing it will let the cal control run and demo how it is used as a data picker.

MSCAL.OCX is installed in every Windows system since W95 I believe.

User avatar
jwestan
Posts: 48
Joined: Wed Mar 18, 2009 2:48 am

Pop Calendar/Date Picker

Post by jwestan » Mon Apr 13, 2009 9:52 am

I figured out one of the issues that I was having..
<script language="text/vbscript"> needed to be <script language="vbscript"> then the calendars started populating the text boxes.

I would still like a smaller footprint if at all possible.

Locked