Web Development

General discussion


making the date appear in a text box

By btrnart ·
Hi guys,

Could anyone please tell me how I can make the date display in a text box with the following attributes. <input name="Arrival" type="text" class="formtxtfield" size="20" maxlength="10">.

I'm sure it is quite simple but I just can't do it.


This conversation is currently closed to new comments.

Thread display: Collapse - | Expand +

All Comments

Collapse -

by rashmigopinath In reply to making the date appear in ...

The following code snippet should solve your purpose:
<body onload="getDate()">
<script language="JavaScript" type="text/javascript">
function getDate(){
var myDate = new Date();
<form name="myForm">
<input type="text" name="myText" size="20">

You can have various date formats too by changing the date format in the myDate variable.


Related Discussions

Related Forums