Fill text box on form with specific date ?

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

    Fill text box on form with specific date ?

    Hi,

    Quick question:

    Using ASP, If I have a text box on a form, how can I auto populate it
    when the form loads with the date of the current Friday, i.e.
    dd/mm/yyyy


    Thanks for your help



    David
  • Evertjan.

    #2
    Re: Fill text box on form with specific date ?

    David wrote on 02 nov 2004 in microsoft.publi c.inetserver.as p.general:[color=blue]
    > the date of the current Friday[/color]

    First you have to define "current".

    is that "next" or "last" Friday?


    --
    Evertjan.
    The Netherlands.
    (Please change the x'es to dots in my emailaddress,
    but let us keep the discussions in the newsgroup)

    Comment

    • Bob Barrows [MVP]

      #3
      Re: Fill text box on form with specific date ?

      David wrote:[color=blue]
      > Hi,
      >
      > Quick question:
      >
      > Using ASP, If I have a text box on a form, how can I auto populate it
      > when the form loads with the date of the current Friday, i.e.
      > dd/mm/yyyy
      >[/color]

      What do you consider to be the current Friday? 2004-10-29? Or 2004-11-5?
      I will assume it to be the first Friday to follow the current date.

      <%
      dim today,curFri
      curFri=date()
      do until weekday(curFri) = vbFriday
      curFri= dateadd("d",1,c urFri)
      loop
      curFri = left("0" & day(curFri),2) & "/" & left("0" & month(curFri),2 ) & _
      "/" & year(curFri)
      %>
      <input value="<%=curFr i%>">

      Bob Barrows
      --
      Microsoft MVP - ASP/ASP.NET
      Please reply to the newsgroup. This email account is my spam trap so I
      don't check it very often. If you must reply off-line, then remove the
      "NO SPAM"


      Comment

      • Dave Anderson

        #4
        Re: Fill text box on form with specific date ?

        Bob Barrows [MVP] wrote:[color=blue]
        > What do you consider to be the current Friday? 2004-10-29? Or
        > 2004-11-5? I will assume it to be the first Friday to follow the
        > current date.[/color]

        Certainly not if the current day is a Friday!



        --
        Dave Anderson

        Unsolicited commercial email will be read at a cost of $500 per message. Use
        of this email address implies consent to these terms. Please do not contact
        me directly or ask me to contact you directly for assistance. If your
        question is worth asking, it's worth posting.


        Comment

        • Bob Barrows [MVP]

          #5
          Re: Fill text box on form with specific date ?

          Dave Anderson wrote:[color=blue]
          > Bob Barrows [MVP] wrote:[color=green]
          >> What do you consider to be the current Friday? 2004-10-29? Or
          >> 2004-11-5? I will assume it to be the first Friday to follow the
          >> current date.[/color]
          >
          > Certainly not if the current day is a Friday!
          >
          >[/color]

          :-)
          handled it in the code even though I didn't express it in my assumption.

          Bob
          --
          Microsoft MVP -- ASP/ASP.NET
          Please reply to the newsgroup. The email account listed in my From
          header is my spam trap, so I don't check it very often. You will get a
          quicker response by posting to the newsgroup.


          Comment

          Working...