Create Pulldown Menus for Month/Day/Year in HTA

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • Sherm Pendley

    #16
    Re: Create Pulldown Menus for Month/Day/Year in HTA

    "VK" <schools_ring@y ahoo.comwrites:
    I just love people who don't learn other things
    Yeah, like the difference between an application and a web page.

    Moron.

    *plonk*

    sherm--

    --
    Web Hosting by West Virginians, for West Virginians: http://wv-www.net
    Cocoa programming in Perl: http://camelbones.sourceforge.net

    Comment

    • RobG

      #17
      Re: Create Pulldown Menus for Month/Day/Year in HTA


      Highlander wrote:
      Hello all. Consider the following HTA:
      [...]
      The script works fine, but I'm wondering if there's any way to
      dynamically populate the pulldown lists with all the months of the
      year, days of the month, etc. - rather than have to list each one out
      like this:
      Given that:

      1. You can't control the order of selection so using script to modify
      date selects rapidly becomes overly complex.
      2. Users without scripting available or enabled (or an incompatible
      browser) can't enter a date at all
      3. Many users find "date selects" annoying

      why not just let the user enter a normal date in a text input?

      --
      Rob

      Comment

      • VK

        #18
        Re: Create Pulldown Menus for Month/Day/Year in HTA

        I just love people who don't learn other things
        >
        Yeah, like the difference between an application and a web page.
        Poor child, did you ever meet "web application" yet? If not then now
        it's your best chance:
        <http://www.google.com/search?hl=en&q= web+application +site%3Aw3.org& btnG=Google+Sea rch>
        Moron.
        Half-wit

        Comment

        • Highlander

          #19
          Re: Create Pulldown Menus for Month/Day/Year in HTA


          mr_unreliable wrote:
          hi Highlander,
          >
          I'm impressed with all that html to get the date,
          but why not let microsoft do the work?
          >
          Microsoft has a "date-picker" control which has
          good-looking graphics, and is familiar to anybody
          who uses windows.
          >
          If you have a recent version of vb (or maybe even
          vba) you will have "date-picker" available, and
          it is scriptable via an actX interface.
          >
          Microsoft's (vb) date-picker is located in mscomct2.ocx.
          There is a demo script attached which shows how to
          use it.
          >
          There is more. Microsoft also published a msCalender
          control (mscal.ocx). There is also a demo script
          (hta) attached, in case you happen to have the mscal
          control on your system. (I personally like the DTP
          better).
          >
          Returning to the date-picker control, if you _don't_
          happen to have microsoft's control installed, there
          are several other versions published. I happen to
          like the ccrp's (Common Control Replacement Project)
          -- a group of guys (sorry, no gals) who are so arrogant
          that they think they can do a better job with the controls
          than microsoft, and generally succeeded.
          >
          Here is a reference to the ccrp "date-picker" control,
          which they call the "Date/Time-Picker":
          >
          Common, Common Control, Replacement, components, controls, comctl32, dll, Common Control Replacement Project, free, controls, ocx, timer, progress bar, file dialog, status bar, browse, browsedialog, listview, treeview, intrinsic, monthcal, folder, datetime, date, time, Visual Basic, Visual Basic 5, Visual Basic 6, Visual, Basic, API, FAQ, Win95

          >
          It is also an actX control and you ought to be able
          to instantiate it on an hta page and also script it,
          even though I don't have a demo of that.
          >
          cheers, jw
          _______________ _______________ _______________ _______________
          >
          You got questions? WE GOT ANSWERS!!! ..(but,
          no guarantee the answers will be applicable to the questions)
          >
          >
          p.s. I have also seen html/dhtml versions of the
          date-picker control, but why bother?
          >
          Highlander wrote:
          Any suggestions would be greatly appreciated.
          Thanks!

          - Dave
          >
          --------------040709090300030 903000607
          Content-Type: text/plain
          Content-Disposition: inline;
          filename="demoM SDTPickerContro l.hta.txt"
          X-Google-AttachSize: 1702
          >
          <HTML>
          <HEAD>
          >
          <HTA:APPLICATIO N ID="oHTA" APPLICATIONNAME ="Show_msCAL "
          WINDOWSTATE="no rmal" SCROLL = "no" BORDERSTYLE="no rmal" BORDER="thin"
          CAPTION="yes" MAXIMIZEBUTTON= "no" MINIMIZEBUTTON= "no" ICON="mru.ico"
          SHOWINTASKBAR=" yes" SINGLEINSTANCE= "yes" SYSMENU="yes" VERSION="1.0" >
          >
          <TITLEdemo msDateTimePicke r control </TITLE>
          <!--
          ' --- description block --------------------------
          '
          ' Title: an HTA to demo ms Date-Picker control...
          '
          ' Description: allows the user to pick a date...
          '
          ' Author: mr_unreliable
          ' Website: none at present,
          ' (but may be found lurking around wsh/vbs ng)...
          '
          ' Usage: Use at you own risk, tested on win98se...
          '
          ' --- revision history ---------------------------
          ' 29Dec06: initial attempt...
          ' --- end of description block -------------------
          -->
          >
          <SCRIPT language="vbscr ipt">
          ' (global code: resize the window)...
          window.ResizeTo 350,300
          >
          Sub btnReadDate_onC lick()
          ' MsgBox("click event detected")
          MsgBox("The msCAL control reads: " & vbCrLf & vbCrLf _
          & CStr(oDTP.Month ) & "/" & CStr(oDTP.Day) & "/" _
          & CStr(oDTP.Year) )
          End Sub
          </SCRIPT>
          </HEAD>
          >
          <BODY bgcolor="silver " style="font:10p t verdana">
          &nbsp;&nbsp;&nb sp;&nbsp; &nbsp;&nbsp;&nb sp;&nbsp;
          <OBJECT ID="oDTP" WIDTH=250 HEIGHT=25
          CLASSID="CLSID: 20DD1B9E-87C4-11D1-8BE3-0000F8754DA1">
          <PARAM NAME="CalendarT itleBackColor" VALUE="-2147483646">
          <PARAM NAME="CalendarT itleForeColor" VALUE="-2147483639">
          </OBJECT>
          <BR><BR><BR>
          <p>Note: to show the date-time-picker graphic,
          you must click on the down arrow to the right of
          the textbox above. </p>
          >
          <BR><BR><BR><BR ><BR>
          <BUTTON id="btnReadDate " Read the Date from msDTP Control </BUTTON>
          </BODY>
          </HTML>
          >
          --------------040709090300030 903000607
          Content-Type: text/plain
          Content-Disposition: inline;
          filename="demoM SCALControl.hta .txt"
          X-Google-AttachSize: 1378
          >
          <HTML>
          <HEAD>
          >
          <HTA:APPLICATIO N ID="oHTA" APPLICATIONNAME ="Show_msCAL "
          WINDOWSTATE="no rmal" SCROLL = "no" BORDERSTYLE="no rmal" BORDER="thin"
          CAPTION="yes" MAXIMIZEBUTTON= "no" MINIMIZEBUTTON= "no" ICON="mru.ico"
          SHOWINTASKBAR=" yes" SINGLEINSTANCE= "yes" SYSMENU="yes" VERSION="1.0" >
          >
          <TITLEdemo msCAL control </TITLE>
          <!--
          ' --- description block --------------------------
          '
          ' Title: an HTA to demo msCAL control...
          '
          ' Description: allows the user to pick a date...
          '
          ' Author: mr_unreliable
          ' Website: none at present,
          ' (but may be found lurking around wsh/vbs ng)...
          '
          ' Usage: Use at you own risk, tested on win98se...
          '
          ' --- revision history ---------------------------
          ' 29Dec06: initial attempt...
          ' --- end of description block -------------------
          -->
          >
          <SCRIPT language="vbscr ipt">
          ' (global code: resize the window)...
          window.ResizeTo 350,300
          >
          Sub btnReadDate_onC lick()
          ' MsgBox("click event detected")
          MsgBox("The msCAL control reads: " & vbCrLf & vbCrLf _
          & CStr(oMSCAL.Mon th) & "/" & CStr(oMSCAL.Day ) & "/" _
          & CStr(oMSCAL.Yea r))
          End Sub
          </SCRIPT>
          </HEAD>
          >
          <BODY bgcolor="silver " style="font:10p t verdana">
          >
          <OBJECT ID="oMSCAL" WIDTH=288 HEIGHT=192
          CLASSID="CLSID: 8E27C92B-1264-101C-8A2F-040224009C02">
          </OBJECT>
          >
          <BR><BR><BR>
          <BUTTON id="btnReadDate " Read the Date from msCAL Control </BUTTON>
          </BODY>
          </HTML>
          >
          --------------040709090300030 903000607--
          JW,

          This is exactly what I was looking for! Selecting dates is now much
          more efficient, there's built-in date validation, and you've cut my
          script down from 181 lines to 56:

          <html>
          <head>
          <title>Date Pulldowns</title>
          <HTA:APPLICATIO N
          ID="HTAUI"
          APPLICATIONNAME ="Date Pulldowns"
          SCROLL="no"
          SINGLEINSTANCE= "yes"
          WINDOWSTATE="ma ximized">
          </head>
          <SCRIPT language="VBScr ipt">
          Dim fromDate, toDate
          Sub Window_Onload
          self.Focus()
          self.ResizeTo 400,200
          self.MoveTo 400,150
          End Sub
          Sub DisplayDatesSub
          fromDate = CStr(FromDTP.Mo nth) & "/" & CStr(FromDTP.Da y) & "/" & _
          CStr(FromDTP.Ye ar)
          toDate = CStr(ToDTP.Mont h) & "/" & CStr(ToDTP.Day) & "/" & _
          CStr(ToDTP.Year )
          MsgBox "From:" & vbTab & fromDate & vbCrlf & "To:" & vbTab & toDate
          End Sub
          </SCRIPT>

          <BODY STYLE="font:6 pt arial; color:white;
          filter:progid:D XImageTransform .Microsoft.Grad ient
          (GradientType=1 , StartColorStr=' #000000', EndColorStr='#0 000FF')">
          <font face="serif" size="4"><b>
          &nbsp;&nbsp;&nb sp;&nbsp;&nbsp; &nbsp;&nbsp;
          FROM:
          &nbsp;&nbsp;&nb sp;&nbsp;&nbsp; &nbsp;&nbsp;&nb sp;&nbsp;&nbsp;
          &nbsp;&nbsp;&nb sp;&nbsp;&nbsp; &nbsp;&nbsp;&nb sp;&nbsp;&nbsp;
          &nbsp;&nbsp;
          TO:
          <br>
          <OBJECT ID="FromDTP" WIDTH=125 HEIGHT=25
          CLASSID="CLSID: 20DD1B9E-87C4-11D1-8BE3-0000F8754DA1">
          <PARAM NAME="CalendarT itleBackColor" VALUE="-2147483646">
          <PARAM NAME="CalendarT itleForeColor" VALUE="-2147483639">
          </OBJECT>
          &nbsp;&nbsp;&nb sp;&nbsp;&nbsp; &nbsp;&nbsp;&nb sp;&nbsp;&nbsp;
          <OBJECT ID="ToDTP" WIDTH=125 HEIGHT=25
          CLASSID="CLSID: 20DD1B9E-87C4-11D1-8BE3-0000F8754DA1">
          <PARAM NAME="CalendarT itleBackColor" VALUE="-2147483646">
          <PARAM NAME="CalendarT itleForeColor" VALUE="-2147483639">
          </OBJECT>
          <p>
          <input id=DisplayDates Button type="button" value="Display Dates"
          name="DisplayDa tes_button"
          onClick="Displa yDatesSub">
          <p>
          </BODY>
          </html>

          One question jw. When the script opens the date fields display the
          current date. After I've made some selections of different dates, is
          there any way to programatically (VBScript) reset the date display to
          the current date? Thanks.

          And thanks to everyone else who had offered their suggestions.

          - Dave

          Comment

          • Harlan Messinger

            #20
            Re: Create Pulldown Menus for Month/Day/Year in HTA

            VK wrote:
            Sherm Pendley wrote:
            >>from c.i.w.a.h. charter:
            >>"This newsgroup covers discussion of HyperText Markup Language (HTML)
            >>as it relates to web page authoring. Possible subjects include HTML
            >>editors, formatting tricks, and current and proposed HTML standards."
            >The key point there is "as it relates to web page authoring".
            >
            Right: "web page authoring", not "authoring for the Web" or so. You may
            want to refresh in your memory the definition of a "web page" /
            "webpage". If you don't have any printed dictionary handy right at this
            second, <http://en.wikipedia.or g/wiki/Webpagemay go for a temporary
            source.
            Wikipedia isn't authoritative.

            A page that won't work on the Web can hardly be considered a web page.
            Not everything written with HTML (*especially* when it's a bastardized
            form of HTML) is a web page, any more than everything written in Java is
            an applet.

            Comment

            • Harlan Messinger

              #21
              Re: Create Pulldown Menus for Month/Day/Year in HTA

              Harlan Messinger wrote:
              VK wrote:
              >Sherm Pendley wrote:
              >>>from c.i.w.a.h. charter:
              >>>"This newsgroup covers discussion of HyperText Markup Language (HTML)
              >>>as it relates to web page authoring. Possible subjects include HTML
              >>>editors, formatting tricks, and current and proposed HTML standards."
              >>The key point there is "as it relates to web page authoring".
              >>
              >Right: "web page authoring", not "authoring for the Web" or so. You may
              >want to refresh in your memory the definition of a "web page" /
              >"webpage". If you don't have any printed dictionary handy right at this
              >second, <http://en.wikipedia.or g/wiki/Webpagemay go for a temporary
              >source.
              >
              Wikipedia isn't authoritative.
              In this case the opening sentence of the article contradicts you anyway.
              "A web page or webpage is a resource of information that is suitable for
              the World Wide Web and can be accessed through a web browser." An HTA
              isn't suitable for the World Wide Web, and it can't be accessed through
              a web browser. It works in IE, but that's because IE has features beyond
              being a web browser.

              Comment

              Working...