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.
This topic is 14 years and 11 months old and has exceeded the time allowed for comments. Please begin a new topic or use the search feature to find a similar but newer topic.
Locked
User avatar
jwestan
Posts: 48
Last visit: Mon May 04, 2015 5:59 am

Pop Calendar/Date Picker

Post by jwestan »

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
Last visit: Mon May 04, 2015 5:59 am

Pop Calendar/Date Picker

Post by jwestan »

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
Last visit: Mon Oct 19, 2015 9:21 am

Pop Calendar/Date Picker

Post by jhicks »

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.
jvierra
Posts: 15439
Last visit: Tue Nov 21, 2023 6:37 pm
Answers: 30
Has voted: 4 times
Been upvoted: 33 times

Pop Calendar/Date Picker

Post by jvierra »

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
Last visit: Mon May 04, 2015 5:59 am

Pop Calendar/Date Picker

Post by jwestan »

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.
This topic is 14 years and 11 months old and has exceeded the time allowed for comments. Please begin a new topic or use the search feature to find a similar but newer topic.
Locked