Current Date into One Line Text Box

J

Jim Buyens

-----Original Message-----
How do I get the current date into a text box in
frontpage?

If your text box is

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

then add

<script>
function initForm(){
curdate = new Date();
if (document.forms[0].txtDate.value == ""){
document.forms[0].txtDate.value = curdate;
}
}
</script>

to your <head> section and

onload="initForm();"

to the <body> tag.

Jim Buyens
Microsoft FrontPage MVP
http://www.interlacken.com
Author of:
*----------------------------------------------------
|\---------------------------------------------------
|| Microsoft Office FrontPage 2003 Inside Out
|| Microsoft FrontPage Version 2002 Inside Out
|| Web Database Development Step by Step .NET Edition
|| Troubleshooting Microsoft FrontPage 2002
|| Faster Smarter Beginning Programming
|| (All from Microsoft Press)
|/---------------------------------------------------
*----------------------------------------------------
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top