473,385 Members | 1,487 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,385 software developers and data experts.

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"); ?>
Jul 17 '05 #1
6 1885
<tr>
<td><b>Date:</b></td>
<td align="left"><input 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.964b98a30938694552c9c831174abe92@t eranews...
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"); ?>

Jul 17 '05 #2
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.net>
wrote:
<tr>
<td><b>Date:</b></td>
<td align="left"><input 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.964b98a30938694552c9c831174abe92@ teranews...
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"); ?>


Jul 17 '05 #3
cover <coverland914 @ yahoo.com> wrote in
news:1113487119.6a09c1cd2c73318276223ef6888b1660@t eranews:
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? :-)

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.
Jul 17 '05 #4
cover <coverland914 @ yahoo.com> wrote in
news:1113487119.6a09c1cd2c73318276223ef6888b1660@t eranews:
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? :-)

orrrr

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

Jul 17 '05 #5

cover wrote:
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? :-)


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

Jul 17 '05 #6
SUCCESS !!!

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

Jul 17 '05 #7

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

5
by: Larry R Harrison Jr | last post by:
I use the Lebans calendar control and love it; the only thing is that it commonly starts out at the year 1899 rather than the current year. Is there a way to specifically tell it to start at the...
2
by: Rose | last post by:
I have a transactions table with a field named Transaction. I want Transaction to be positive for input and negative for outflow. How do I set up the form for entering outflow so for data entry,...
5
by: Paul | last post by:
Hi This has taken me ages to work out but i'm sure there is a simple explanation and somebody here will be able to help. I'll talk you through it as best i can: 1. User enters dates on an...
2
by: Bob Sanderson | last post by:
I have a date field in my database which is set to accept NULLs. If I enter a record from phpMyAdmin and leave the date field blank, the record is entered properly. However, if I do the same thing...
0
by: nir_yacoby | last post by:
OBJECTIVE: to be able to see the last 10 customers i've seen in a certain form (call that form Exchange). MEANS: a date field in the Customers table should be set to Now() every time I move a...
3
by: cyber0ne | last post by:
I'm designing a basic form for data entry into one main table. There are two fields in the table that I would like to be automatically populated, not user-entered, when the record is posted. ...
3
by: Don | last post by:
Hi, I would like my users to be able to enter STARTDATE and leave the ENDDATE open in the query by form that I have built. Using some code from another group post I have this within my SQL...
1
by: aRTx | last post by:
<? /* Directory Listing Script - Version 2 ==================================== Script Author: Artani <artan_p@msn.com>. www.artxcenter.com REQUIREMENTS ============ This script requires...
3
by: aRTx | last post by:
I have try a couple of time but does not work for me My files everytime are sortet by NAME. I want to Sort my files by Date-desc. Can anyone help me to do it? The Script <? /* ORIGJINALI
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.