This is a discussion on Prefill a text form field with the current date. within the HTML, CSS and Javascript Coding Techniques forums, part of the Web Development category; Hi all... Can anyone tell me how can i prefill a text form field with the current date. Thanks in ...
| |||||||
| Register | FAQ | Members List | Calendar | Mark Forums Read |
| |||
| Hi all... <html> <head> <script language="JavaScript"><!-- function makeDate() { now = new Date(); return now.getYear() + '/' + (now.getMonth()+1) + now.getDate(); } //--></script> </head> <body onLoad="document.myForm.myField.value = makeDate()"> <form name="myForm"> <input type="text" name="myField" value=""> </form> </body> </html> Thanks... |
![]() |
| Thread Tools | |
| Display Modes | |
| |
Similar Threads | ||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| store the current date in a hidden form field. | itbarota | HTML, CSS and Javascript Coding Techniques | 1 | 02-10-2008 09:36 PM |
| Date/time stamp a form field as the form is submitted | itbarota | HTML, CSS and Javascript Coding Techniques | 1 | 02-06-2008 10:16 PM |
| Date and time displayed in a hidden form field. | itbarota | HTML, CSS and Javascript Coding Techniques | 2 | 02-01-2008 09:47 PM |
| Date/Time stamp a form field as the form is submitted | itbarota | HTML, CSS and Javascript Coding Techniques | 2 | 01-17-2008 08:47 PM |
| How do I check that text entered in a text form field is an integer? | itbarota | HTML, CSS and Javascript Coding Techniques | 2 | 10-26-2007 12:25 AM |