Code Comments

Programming Forum and web based access to our favorite programming groups.
For Programmers: Free Programming Magazines | New: Database administration forum
Registration is free! Edit your profileCalendarFind other membersFrequently Asked QuestionsSearch -> 
Post New Thread











Thread
Author

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"><input type="text" name="date" size="8"
maxlength="8"></td>
</tr>

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

Report this thread to moderator Post Follow-up to this message
Old Post
cover
04-14-05 08:56 AM


Re: Entering the date as default within a form
"cover" <coverland914 @ yahoo.com> wrote in message
news:1113454894. 4bb141615120e1296a93de388b824915@teranew
s...
> 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"><input type="text" name="date" size="8"
>     maxlength="8"></td>
> </tr>
>
> php code
> <? print strftime("%m/%d/%Y");  ?>

<input type="text" name="date" size="8" maxlength="8"
value="<? print strftime("%m/%d/%Y");  ?>">



--
Welcome to Usenet! Please leave tolerance, understanding
and intelligence at the door. They aren't welcome here.
eternal piste erection miuku gmail piste com



Report this thread to moderator Post Follow-up to this message
Old Post
Kimmo Laine
04-14-05 08:56 AM


Re: Entering the date as default within a form
On Thu, 14 Apr 2005 08:51:44 +0300, "Kimmo Laine"
<eternal.erectionN05P@Mgmail.com> wrote:

>"cover" <coverland914 @ yahoo.com> wrote in message
>news:1113454894. 4bb141615120e1296a93de388b824915@teranew
s... 
>
><input type="text" name="date" size="8" maxlength="8"
>value="<? print strftime("%m/%d/%Y");  ?>">


Tried replacing with your suggested code and the <? print strftrime(
shows up in the form frame window with "> on the outside of the frame
(just to the right).  Thank you for the reply.  Did that little
snippet of code work on your end with your suggestion?


Report this thread to moderator Post Follow-up to this message
Old Post
cover
04-14-05 08:55 PM


Re: Entering the date as default within a form
cover wrote:
> On Thu, 14 Apr 2005 08:51:44 +0300, "Kimmo Laine"
> <eternal.erectionN05P@Mgmail.com> wrote:
>
> 
>
>
>
> Tried replacing with your suggested code and the <? print strftrime(
> shows up in the form frame window with "> on the outside of the frame
> (just to the right).  Thank you for the reply.  Did that little
> snippet of code work on your end with your suggestion?
>

Try <?php instead of <?. <? only works if short_open_tag is enabled, and
sounds as if it isn't on your set-up.

--
Oli

Report this thread to moderator Post Follow-up to this message
Old Post
Oli Filth
04-14-05 08:55 PM


Re: Entering the date as default within a form
"cover" <coverland914 @ yahoo.com> kirjoitti
viestissä:1113486217. 4f48b735f5fb347837b4f6a225e796bd@teranew
s...
> On Thu, 14 Apr 2005 08:51:44 +0300, "Kimmo Laine"
> <eternal.erectionN05P@Mgmail.com> wrote:
> 
>
>
> Tried replacing with your suggested code and the <? print strftrime(
> shows up in the form frame window with "> on the outside of the frame
> (just to the right).  Thank you for the reply.  Did that little
> snippet of code work on your end with your suggestion?
>

That just means that PHP was not executed. I didn't test it, but I've done
it million gazillion times to know it works if everything else is okay. I'm
curious though, in your previous example: was the date output correctly when
the php code was outside the input field? I mean if it was: I don't know
what the hell broke it now. It should've been printed below the input field.
Just do what Oli suggested and replace <? ?> with <?php ?>. And tell us if
you usually get any kind of php output.



Report this thread to moderator Post Follow-up to this message
Old Post
Kimmo Laine
04-14-05 08:55 PM


Re: Entering the date as default within a form
On Thu, 14 Apr 2005 08:51:44 +0300, "Kimmo Laine"
<eternal.erectionN05P@Mgmail.com> wrote:

>"cover" <coverland914 @ yahoo.com> wrote in message
>news:1113454894. 4bb141615120e1296a93de388b824915@teranew
s... 
>
><input type="text" name="date" size="8" maxlength="8"
>value="<? print strftime("%m/%d/%Y");  ?>">


SUCCESS !!!

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

Report this thread to moderator Post Follow-up to this message
Old Post
cover
04-15-05 08:56 AM


Re: Entering the date as default within a form
cover wrote:
> On Thu, 14 Apr 2005 08:51:44 +0300, "Kimmo Laine"
> <eternal.erectionN05P@Mgmail.com> wrote:
>
> 
>
>
>
> Tried replacing with your suggested code and the <? print strftrime(
> shows up in the form frame window with "> on the outside of the frame
> (just to the right).  Thank you for the reply.  Did that little
> snippet of code work on your end with your suggestion?
>

Try <?php instead of <?. <? only works if short_open_tag is enabled, and
sounds as if it isn't on your set-up.

--
Oli

Report this thread to moderator Post Follow-up to this message
Old Post
Oli Filth
04-16-05 08:56 PM


Re: Entering the date as default within a form
"cover" <coverland914 @ yahoo.com> kirjoitti
viestissä:1113486217. 4f48b735f5fb347837b4f6a225e796bd@teranew
s...
> On Thu, 14 Apr 2005 08:51:44 +0300, "Kimmo Laine"
> <eternal.erectionN05P@Mgmail.com> wrote:
> 
>
>
> Tried replacing with your suggested code and the <? print strftrime(
> shows up in the form frame window with "> on the outside of the frame
> (just to the right).  Thank you for the reply.  Did that little
> snippet of code work on your end with your suggestion?
>

That just means that PHP was not executed. I didn't test it, but I've done
it million gazillion times to know it works if everything else is okay. I'm
curious though, in your previous example: was the date output correctly when
the php code was outside the input field? I mean if it was: I don't know
what the hell broke it now. It should've been printed below the input field.
Just do what Oli suggested and replace <? ?> with <?php ?>. And tell us if
you usually get any kind of php output.



Report this thread to moderator Post Follow-up to this message
Old Post
Kimmo Laine
04-16-05 08:56 PM


Sponsored Links




Last Thread Next Thread Next
Search this forum -> 
Post New Thread

PHP Language archive

Show a Printable Version Send to friend Email This Page to Someone! subscribe to this thread Receive updates to this thread
Computer Consultants
Programming Jobs
Visual Basic Controls
SQL Server Programming
Webservices
Java Security
Visual Studio
C# Programming
Visual J++
Software engineering
Open source Software
Perl Programming
PHP Programming
ASP Programming
ASP .NET Programming
Visual Basic Programming
Windows Scripting Host
Java Programming
Java Help
Java Beans
VBScript
Cobol
MAC Applications
Unix Programming
Forum Jump:
All times are GMT. The time now is 07:05 PM.

 
Free MCSE Braindumps | Real Estate Topics

Programming forum archive

Copyrights CodeComments.com 2004 - 2006

Powered by vBulletin Copyright 2000-2006 Jelsoft Enterprises Limited.