473,508 Members | 2,475 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Putting date in the text box


What I am trying to do is when the user clicks on the date th
month/date/year appears in the text box like this: 1/15/2004. Ho
would I do this. This is not home work, but it is for a client o
mine.
Calendar Code:
<html>
<head>
<style>
.cw {width:20px}
.jan{
position:absolute;
font-family:comic sans ms;
width: 147px;
height: 21px;
text-align:center;
left: -1px;
top: 4px;
}
.date{
position:absolute;
font-family:comic sans ms;
left: 1px;
top: 38px;
width: 143px;
height: 10px;
}
.close{
text-align:center;
}

</style>
<script>
function a() {
document.getElementById('show_cal').style.visibili ty = 'visible';
}
</script>
</head>
<body>

<input type="text" name="txtDate">

<input name="button" type="button" onClick="a()" value="Calendar">
<div id ="show_cal" style="position: absolute; top: 52px; left:162px
border: solid; visibility:hidden; width: 151px; height: 198px;">
<br><br>
<table class="jan" border="1">
<tr>
<td>January</td>
</tr>
</table>
<table width="145" border="0" class="date">
<tr>
<td>s</td>
<td>m</td>
<td>t</td>
<td>w</td>
<td>r</td>
<td>f</td>
<td>s</td>
</tr>
</table>
<br><br>
<script>

ms = 5;
dm = 31;
d = 1;

for (i=1; i<=42;i++){

if ( i >= ms && d <=dm)
{
html ="<input type='text' class='cw' value=" + d + ">";
d++;
}
else
{
html = "<input type='text' class='cw'>";
}
document.write(html);

if (i % 7 == 0){
document.write("<br>");
}

}

</script>
<a class="close" href="#
onclick="parentNode.style.visibility='hidden';"><c enter>Close</center></a>
</div>

</body>
</html

newtd
-----------------------------------------------------------------------
Posted via http://www.forum4designers.co
-----------------------------------------------------------------------
View this thread: http://www.forum4designers.com/message33119.htm

Jul 20 '05 #1
1 1260
Lee
newtda said:


What I am trying to do is when the user clicks on the date the
month/date/year appears in the text box like this: 1/15/2004. How
would I do this. This is not home work, but it is for a client of
mine.


If this really isn't homework, you should consider taking a class
before taking on any more clients.

Google for "popup calendar javascript" and you'll probably find
several date pickers to choose from.

Jul 20 '05 #2

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

Similar topics

4
1606
by: Toby A Inkster | last post by:
In "the other place" Jukka has pointed out that semantically <blockquote/> is useless in many browsers, so I'm experimenting with Javascript to put some functionality back into <blockquote/>. ...
9
2525
by: Shaiboy_UK | last post by:
Hi all, Hopefully something simple here. I have written a form that takes data from a text box and updates it into an Access database. However, I want to also pass the local user date and...
3
2112
by: Patrick | last post by:
Try to put in a TextBox next month's date in format (MMM yyyy). The following does NOT work, why is that? <!--When rendered, the texbox is blank, although the text in the round bracket after the...
3
8808
by: Ivan V via DotNetMonster.com | last post by:
Dear All: I got a serious problem in updating the date field from vb.net to abd dbf file. My code is as follow: Dim ConnectionString As String Dim cake As Date = Date.Parse(idate) ...
3
3274
by: Jim in Arizona | last post by:
I have a gridview that's being populated from an access db query. The problem I'm having is that the date/time fields in access that are populating the gridview are showing both date and time, when...
1
1999
by: nagamalli26 | last post by:
hai iam new php. i am creating admin side. i wrote this, phpcode: <?php //include_once("config.php"); $con=mysql_connect("localhost","root",""); mysql_select_db("happysalary"); ?>
7
2085
by: creative1 | last post by:
Hello everyone. I am experiencing a strange problem that I can't fix on my own. I think I need expert's suggestions for this. The problem is: I want to print account statement (or any other...
9
2023
by: RobertTheProgrammer | last post by:
Hi folks, I've been struggling with this for a few hours and I'm hoping someone can help me out. On my GridView (with C# codebehind) I have a date entry field. To help users enter only valid...
1
3672
by: rjlorenzo | last post by:
Good Day, Need your help guys, right now i have a text box where they enter the date with format mm/dd/yyy. Instead mo this i just wnat to put a pop up calendar. when the user click the "Date...
0
7231
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
7133
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
7336
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
7405
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
7504
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
1
5059
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 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 a new...
0
1568
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated ...
1
773
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
0
435
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence...

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.