Entering the date as default within a form

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

    #1

    Entering the date as default within a form

    Anyone know how to enter the time into a form or a website that might
    tell how? I'm using the following html code and trying to get the
    time to default into the text box. thanks

    html code
    <tr>
    <td><b>Date:</b></td>
    <td align="left"><i nput type="text" name="date" size="8"
    maxlength="8"></td>
    </tr>

    php code
    <? print strftime("%m/%d/%Y"); ?>
  • Duyet The Vo

    #2
    Re: Entering the date as default within a form

    <tr>
    <td><b>Date:</b></td>
    <td align="left"><i nput type="text" name="date" size="8"
    value="<?php print strftime("%m/%d/%Y"); ?>"
    maxlength="8"></td>
    </tr>



    "cover" <coverland914 @ yahoo.com> wrote in message
    news:1113455064 .964b98a3093869 4552c9c831174ab e92@teranews...[color=blue]
    > Anyone know how to enter the time into a form or a website that might
    > tell how? I'm using the following html code and trying to get the
    > time to default into the text box. thanks
    >
    > html code
    > <tr>
    > <td><b>Date:</b></td>
    > <td align="left"><i nput type="text" name="date" size="8"
    > maxlength="8"></td>
    > </tr>
    >
    > php code
    > <? print strftime("%m/%d/%Y"); ?>[/color]


    Comment

    • cover

      #3
      Re: Entering the date as default within a form

      Inserting that into the html causes <?php print strftime( to be echoed
      inside the form field and " maxlength="8"> to show up just outside and
      to the right of the form field. Thank you for your reply though - any
      other ideas? :-)

      Chris


      On Thu, 14 Apr 2005 07:35:07 +0200, "Duyet The Vo" <me@nospam.ne t>
      wrote:
      [color=blue]
      ><tr>
      > <td><b>Date:</b></td>
      > <td align="left"><i nput type="text" name="date" size="8"
      > value="<?php print strftime("%m/%d/%Y"); ?>"
      > maxlength="8"></td>
      ></tr>
      >
      >
      >
      >"cover" <coverland914 @ yahoo.com> wrote in message
      >news:111345506 4.964b98a309386 94552c9c831174a be92@teranews.. .[color=green]
      >> Anyone know how to enter the time into a form or a website that might
      >> tell how? I'm using the following html code and trying to get the
      >> time to default into the text box. thanks
      >>
      >> html code
      >> <tr>
      >> <td><b>Date:</b></td>
      >> <td align="left"><i nput type="text" name="date" size="8"
      >> maxlength="8"></td>
      >> </tr>
      >>
      >> php code
      >> <? print strftime("%m/%d/%Y"); ?>[/color]
      >[/color]

      Comment

      • Good Man

        #4
        Re: Entering the date as default within a form

        cover <coverland914 @ yahoo.com> wrote in
        news:1113487119 .6a09c1cd2c7331 8276223ef6888b1 660@teranews:
        [color=blue]
        > Inserting that into the html causes <?php print strftime( to be echoed
        > inside the form field and " maxlength="8"> to show up just outside and
        > to the right of the form field. Thank you for your reply though - any
        > other ideas? :-)[/color]


        you already posted this to another group today (alt.php) and came across
        the same problem.

        if your form field is showing PHP code, guess what, you don't have PHP on
        your server.

        Comment

        • Good Man

          #5
          Re: Entering the date as default within a form

          cover <coverland914 @ yahoo.com> wrote in
          news:1113487119 .6a09c1cd2c7331 8276223ef6888b1 660@teranews:
          [color=blue]
          > Inserting that into the html causes <?php print strftime( to be echoed
          > inside the form field and " maxlength="8"> to show up just outside and
          > to the right of the form field. Thank you for your reply though - any
          > other ideas? :-)[/color]


          orrrr

          if you DO have PHP installed on your server, change the extension on your
          file from .html to .php

          Comment

          • Ken Robinson

            #6
            Re: Entering the date as default within a form


            cover wrote:[color=blue]
            > Inserting that into the html causes <?php print strftime( to be[/color]
            echoed[color=blue]
            > inside the form field and " maxlength="8"> to show up just outside[/color]
            and[color=blue]
            > to the right of the form field. Thank you for your reply though -[/color]
            any[color=blue]
            > other ideas? :-)[/color]

            What is the name of the file containing the HTML? If it is xyz.html or
            xyz.htm then your webserver doesn't know to send the file through PHP
            to be processed, unless you've told it to. Make sure the name of your
            file is xyz.php and then try it again.

            Ken

            Comment

            • cover

              #7
              Re: Entering the date as default within a form

              SUCCESS !!!

              Thank you everyone who replied. Appreciate your help and time very
              much... :-)

              Comment

              Working...