Results 1 to 7 of 7
  1. #1
    billeger
    Guest

    Today's date on form (FP 2002 SP-2)

    On a form used as an order blank, I want the form to report 'today's date.'
    I've tried every way I can think of, searched in every place I can find -- and
    that includes a very red-faced me who accidentally put this question in
    the Access forum because we use that database at the receiving end....

    [Ah me, please excuse me HansV! <img src=/S/stupidme.gif border=0 alt=stupidme width=30 height=30> ]

    Anyway, does anyone know how to make that text box report today's date?

    Thank you in advance and I'll thank you again later.

    Hawai`i Bill

  2. #2
    Super Moderator jscher2000's Avatar
    Join Date
    Feb 2001
    Location
    Silicon Valley, USA
    Posts
    23,112
    Thanks
    5
    Thanked 93 Times in 89 Posts

    Re: Today's date on form (FP 2002 SP-2)

    If you make your form an ASP page, yes, you probably can do it this way:

    <input TYPE="Text" NAME="TextBox1" VALUE="<%=FormatDateTime(Date, 2)%>" size="30">

    Now, <%=Date%> might work by itself, but using FormatDateTime helps you guarantee that you get the format you want (or at least close to what you want). For more options, see Visual Basic Scripting Edition: FormatDateTime Function or your favorite VBScript reference.

  3. #3
    billeger
    Guest

    Re: Today's date on form (FP 2002 SP-2)

    If I knew how to code VBA, create ASP pages, etc., I wouldn't need FrontPage. My ability to learn that next set of steps isn't limited by lack of trying. Just can't comprehend it though way back I was a good programmer -- until Windows came along!

    But how can it be that MS doesn't recognize variables -- such as =date() -- in FrontPage form field text boxes? My question is really whether such a recognition capability exists and it's simply not documented. The date wouldn't need to be in a text box, but would be just as valuable derived from any other source and delivered as one of the form's field reports. <img src=/S/frown.gif border=0 alt=frown width=15 height=15>

    Aloha from the middle of the Pacific Ocean.

    Bill
    Attached Images Attached Images

  4. #4
    Super Moderator jscher2000's Avatar
    Join Date
    Feb 2001
    Location
    Silicon Valley, USA
    Posts
    23,112
    Thanks
    5
    Thanked 93 Times in 89 Posts

    Re: Today's date on form (FP 2002 SP-2)

    > But how can it be that MS doesn't recognize variables -- such as =date() -- in FrontPage form field text boxes?

    Because they are, for the most part, just helping you make plain old HTML pages?

    Using a tiny bit of ASP on a page is a matter of adding the code and changing the file name extension to ASP from HTM(L). The web server will skim any page with that extension before sending it to the browser, and process the ASP code. This assumes your web server is IIS, which most FrontPage hosts seem to use.

    You actually don't need to use the ASP processor on the server to populate the date into the Text control if you can trust that your users will have JavaScript enabled. You can create a control, and fill in its default value, and even make it read-only, with a small snippet of code typed into your form:

    <pre>

    <input type="text" name="T1" size="20" value="Something"></p>
    <script>
    today = new Date();
    self.document.write('<input type="text" name="Date" value="' + today.getMonth() + '/' +
    today.getDate() + '/' + today.getFullYear() + '" READONLY></p>');
    </script>


    <input type="submit" value="Submit" name="B1"><input type="reset"
    value="Reset" name="B2"></p></pre>

    If you put this into a form on a new page in FP2000, it previews as shown in the attached.
    Attached Images Attached Images

  5. #5
    billeger
    Guest

    Re: Today's date on form (FP 2002 SP-2)

    There are several reasons I'll soon be using Woody's web hosting. One of them is that I can't depend on any of the parameters you describe being present for use with my present host -- who shall remain nameless. If anyone wants a private caution about the rascals I'm presently on, just drop me an email.

    There is no question in my mind that Woody's web will work as it should and that doubtless includes the properties you suggest. Because the change will be made soon, I'll hold on to your excellent post and make that and several other changes at the same time -- after I have the excellent service we can always count on from Woody installed.
    Attached Images Attached Images

  6. #6
    Platinum Lounger
    Join Date
    Dec 2000
    Location
    Hornsby Heights, New South Wales, Australia
    Posts
    3,822
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Today's date on form (FP 2002 SP-2)

    Bill:

    "There are several reasons I'll soon be using Woody's web hosting."

    Woody <big>doesn't</big> offer a web hosting service. Besides, this Lounge runs on Perl / Linux. As a FP user you'd want a windows based hosting, ASP isn't supported by most Linux servers..
    Cheers, Claude.

  7. #7
    billeger
    Guest

    Re: Today's date on form (FP 2002 SP-2)

    Ah me, you've got to watch me every minute! The February 19 Woody's Windows XP newsletter had a very clever ad that LOOKED for all the world as though it were Woody's web site. NOT the case, I now see! Going back for another look I find it's http://www.powweb.com/ and, as you recommend correctly, fully set up with FrontPage extensions, etc. You may be interested to know that some web hosts run those on Linux but please don't ask me how. My hope is that they are worthy of being in Woody's newsletter. If they are half as good as those of you who look after Woody's Lounge then they are truly great.

    Thank you for all you do, including kind patience with my errors, all of innocence born.
    <font face="Snap ITC">Hawai`i Bill</font face=snap>

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •