Still not showing when I click the button. I also tried putting my_time into the field.
RO -----Original Message----- From: "Michael Grant" <mgr...@modus.bz> Sent: Tuesday, January 4, 2011 10:05am To: "cf-talk" <cf-talk@houseoffusion.com> Subject: Re: SOT: Show time in field on click Javascript is case-sensitive. I notice your form field is named "mydate" instead of "myDate" On Tue, Jan 4, 2011 at 9:57 AM, Orlini, Robert <rorl...@hwwilson.com> wrote: > > Thanks much for the suggestion Michael. > > It does not seem to paste the date into the field though. Let meknow please > if I am missing something in my coding below: > > <script type="text/javascript"> > function show_now() { > var my_time = new Date(); > document.myForm.myDate.value = my_time; > } > </script> > > <body bgcolor="#ffffff" text="#000000" link="#0000ff" vlink="#800080" > alink="#ff0000"> > > <form name="myform"> > <input name="mydate" type="text" size="10" /> > <input type=button value="Show Time" onclick="show_now();"> > </form> > > -----Original Message----- > From: "Michael Grant" <mgr...@modus.bz> > Sent: Monday, January 3, 2011 3:29pm > To: "cf-talk" <cf-talk@houseoffusion.com> > Subject: Re: SOT: Show time in field on click > > > say you have a field named "myDate" in a form named "myForm" then instead > of: > > alert(my_time); > > put: > > document.myForm.myDate.value = my_time; > > > > > On Mon, Jan 3, 2011 at 3:25 PM, Orlini, Robert <rorl...@hwwilson.com> > wrote: > > > > > Hi, > > > > I have this code I gleaned that will show the time as a popup when > clicked. > > I was wondering how I can have it enter the time into an input field of a > > form as opposed to being a popup? > > > > Thanks. > > > > RO > > HWW > > > > > > <html> > > <head> > > <title>(Type a title for your page here)</title> > > <script type="text/javascript"> > > function show_now() { > > var my_time = new Date(); > > alert(my_time); > > } > > </script> > > </head> > > > > > > <body bgcolor="#ffffff" text="#000000" link="#0000ff" vlink="#800080" > > alink="#ff0000"> > > > > <input type=button value="Show Time" onclick="show_now();"> > > > > </body> > > </html> > > > > > > > > > > > > > > > > ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~| Order the Adobe Coldfusion Anthology now! http://www.amazon.com/Adobe-Coldfusion-Anthology/dp/1430272155/?tag=houseoffusion Archive: http://www.houseoffusion.com/groups/cf-talk/message.cfm/messageid:340369 Subscription: http://www.houseoffusion.com/groups/cf-talk/subscribe.cfm Unsubscribe: http://www.houseoffusion.com/groups/cf-talk/unsubscribe.cfm