Wednesday, November 14, 2012

Answers > How to Display Current Date Using Javascript in a Textbox(xhtml)?

How to Display Current Date Using Javascript in a Textbox(xhtml)?

by nForms on May 15, 2011

I have to create a text box in xhtml which displays the current date. The current date is produced by using javascript.
How do i do that? Do i create a function and call it? or do I do something else.
Thank You.

Tags: , , ,

display current date in javascript, how to display current date in javascript

Similar XForms | XML Posts

{ 1 comment… read it below or add one }

Neneng_Questionaire May 15, 2011 at 9:35 am

<html>
<head>
<title>test</title>
<script language="javascript"
type="text/javascript">
function showDate() {
document
.getElementById("txtDate")
.value = Date();
}
</script>
</head>
<body onload="showDate()">
<input id="txtDate" type="text" />
</body>
</html>

Previous post:

Next post: