posted 18 years ago
Hi,
The following code is on my second page. There is a form field called
time, I want to set it to user's current time after user hits submit button on the first page and comes to this page. I use javascript code like the following
to do that. But it seems it never sets the time value after I come to second page:
<script language="JavaScript">
times=new Date();
document.form2.time.value = times;
</script>
<form name="form2" action="nextPage.php" method="post">
<table>
<tr>
<td> Name:<input id="name" size="10" name="name"></td>
<td> Phone:<input id="phone" size="10" name="phone"></td>
<td> Zip Code:<input id="zipcode" size="5" name="zipcode"></td>
<td> Address:<input id="address" size="30" name="address"></td>
<td> Time:<td><input name="time" value="" readonly /></td>
</tr>
<tr>
<td><input type="button" value="Submit" name="Submit2"></td>
</tr>
</table>
I am wondering what I did wrong here?
thanks,