I am trying to put the date and time into a form field onload. Am I doing something wrong here, I can't get it to work. Here is my code:
<HEAD>
<script type="text/javascript">
function updateData()
{
var cl_dt=new Date();
document.getElementByName("lastpost_cl").value=cl_dt;
}
</script>
</HEAD>
<BODY onLoad="updateData();">
<form id="FormName" action="updated.php" method="post" name="FormName">
<input id="lastpost_cl" name="lastpost_cl" type="text" size="25" maxlength="255">
<BODY>and<HEAD>, nor camel case attributes likeonLoad- stick with lower case all the way. Also, if this is the full scope of what you're trying to do don't bother with jQuery; it would be like killing an ant hill with the Stark Jericho missile.