Re: SOT: Show time in field on click

2011-01-05 Thread Michael Grant
how_now() { > > var my_time = new Date(); > > document.getElementById('myDate').value = my_time.toLocaleTimeString(); > > } > > > > > > > > > > > > > > > > -Original Message- > > From: "Russ Michaels"

RE: SOT: Show time in field on click

2011-01-04 Thread Russ Michaels
Still missing the point, but nevermind. -Original Message- From: Michael Grant [mailto:mgr...@modus.bz] Sent: 04 January 2011 18:21 To: cf-talk Subject: Re: SOT: Show time in field on click Right. But it's not the use of getElementById that "fixed" your code. It

Re: SOT: Show time in field on click

2011-01-04 Thread Michael Grant
> > Thanks. > > RO > > -Original Message- > From: "Michael Grant" > Sent: Tuesday, January 4, 2011 1:21pm > To: "cf-talk" > Subject: Re: SOT: Show time in field on click > > > Right. But it's not the use of getElementById that &quo

Re: SOT: Show time in field on click

2011-01-04 Thread Orlini, Robert
OK I see. Why does Javascript have to be so sensitive with cases. Thanks. RO -Original Message- From: "Michael Grant" Sent: Tuesday, January 4, 2011 1:21pm To: "cf-talk" Subject: Re: SOT: Show time in field on click Right. But it's not the use of getElem

Re: SOT: Show time in field on click

2011-01-04 Thread Michael Grant
gt; -----Original Message- > From: "Russ Michaels" > Sent: Tuesday, January 4, 2011 1:05pm > To: "cf-talk" > Subject: Re: SOT: Show time in field on click > > > Michael, > > you do indeed need an ID to be defined to use getElementById(), the clue

Re: SOT: Show time in field on click

2011-01-04 Thread Orlini, Robert
agin. RO HWW function show_now() { var my_time = new Date(); document.getElementById('myDate').value = my_time.toLocaleTimeString(); } -Original Message- From: "Russ Michaels" Sent: Tuesday, January 4, 2011 1:05pm To: "cf-talk" Subject: Re: SO

Re: SOT: Show time in field on click

2011-01-04 Thread Russ Michaels
Michael, if you refer back to the example code I provided which he says solved his problem, I used getElementById. In which case removing the ID will break this code. Russ On Tue, Jan 4, 2011 at 6:08 PM, Michael Grant wrote: > > Of course you do. We weren't talking about that though, we were t

Re: SOT: Show time in field on click

2011-01-04 Thread Ian Skinner
On 1/4/2011 10:05 AM, Russ Michaels wrote: > Michael, > > you do indeed need an ID to be defined to use getElementById(), True, if you use the getElementByID() function. But Russ was showing the docuement.formName.inputName syntax which is based on names and thus you do not need to use IDs w

Re: SOT: Show time in field on click

2011-01-04 Thread Michael Grant
Of course you do. We weren't talking about that though, we were talking about using dot notation which targets the name field. You don't need to have an ID to do what the OP was looking for. Telling them they need it is just confusing. On Tue, Jan 4, 2011 at 1:05 PM, Russ Michaels wrote: > > M

Re: SOT: Show time in field on click

2011-01-04 Thread Russ Michaels
Michael, you do indeed need an ID to be defined to use getElementById(), the clue is in the function itself, it gets the DOM reference for an object by its ID, if you do not have such an ID then it will not find the object. Feel free to look it up on the w3c site or similar. Russ On Tue, Jan 4,

RE: SOT: Show time in field on click

2011-01-04 Thread Larry Juncker
uot; + a_p; document.myForm.myTime.value = my_time; This display HH:MM:SS A/P Larry -Original Message- From: Orlini, Robert [mailto:rorl...@hwwilson.com] Sent: Tuesday, January 04, 2011 10:14 AM To: cf-talk Subject: RE: SOT: Show time in field on click Thank you Larry, Russ, and Mike. T

RE: SOT: Show time in field on click

2011-01-04 Thread Orlini, Robert
(); document.getElementById('myDate').value = my_time.toTimeString(); } -Original Message- From: "Larry Juncker" Sent: Tuesday, January 4, 2011 11:08am To: "cf-talk" Subject: RE: SOT: Show time in field on click This edited script will show date or time, w

RE: SOT: Show time in field on click

2011-01-04 Thread Larry Juncker
me = months[month] + " " + day + ", " + year; var my_time = curr_hour+":"+curr_min + " " + a_p; document.myForm.myDate.value = my_time; } -Original Message- From: Larry Juncker [mailto:la...@aljcs.com] Sent: Tuesday, January 04, 2011 10:01

RE: SOT: Show time in field on click

2011-01-04 Thread Larry Juncker
Hope that helps with the date portion -----Original Message- From: Orlini, Robert [mailto:rorl...@hwwilson.com] Sent: Tuesday, January 04, 2011 8:58 AM To: cf-talk Subject: Re: SOT: Show time in field on click Thanks much for the suggestion Michael. It does not seem to paste the

Re: SOT: Show time in field on click

2011-01-04 Thread Ian Skinner
On 1/4/2011 7:44 AM, Orlini, Robert wrote: > Russ/Mike, > > Is there a way just to show the time and not the date? Ok, looking closer at the full date object reference. http://www.w3schools.com/jsref/jsref_obj_date.asp toTimeString() OR toLocalTimeString() are probably what you are looking for

Re: SOT: Show time in field on click

2011-01-04 Thread Michael Grant
to show the time and not the date? > > > function show_now() { > var my_time = new Date(); > document.getElementById('myDate').value = my_time; > } > > > -Original Message- > From: "Russ Michaels" > Sent: Tuesday, January 4, 2011 10

Re: SOT: Show time in field on click

2011-01-04 Thread Ian Skinner
On 1/4/2011 7:44 AM, Orlini, Robert wrote: > Russ/Mike, > > Is there a way just to show the time and not the date? Use the appropriate methods of the date object. http://www.w3schools.com/js/js_obj_date.asp I would probably start with the getTime() method. document.myForm.myField.value = my_

Re: SOT: Show time in field on click

2011-01-04 Thread Orlini, Robert
f-talk" Subject: Re: SOT: Show time in field on click try this document.getElementById('myDate').value = my_time; your field must have an id of "myDate" e.g. Russ On Tue, Jan 4, 2011 at 3:27 PM, Michael Grant wrote: > > No, they refer to the name attribute. >

Re: SOT: Show time in field on click

2011-01-04 Thread Michael Grant
2011 10:36am > To: "cf-talk" > Subject: Re: SOT: Show time in field on click > > > try this > > document.getElementById('myDate').value = my_time; > > your field must have an id of "myDate" > > e.g. > > > Russ > On Tue

Re: SOT: Show time in field on click

2011-01-04 Thread Michael Grant
That's not true at all. You don't need id defined. The following code is completely functional. function show_now() { var my_time = new Date(); document.myForm.myDate.value = my_time; } On Tue, Jan 4, 2011 at 10:36 AM, Russ Michaels wrote: > > try this > > document.getElementById

Re: SOT: Show time in field on click

2011-01-04 Thread Orlini, Robert
That did it. Thank you Mike and Russ! RO -Original Message- From: "Russ Michaels" Sent: Tuesday, January 4, 2011 10:36am To: "cf-talk" Subject: Re: SOT: Show time in field on click try this document.getElementById('myDate').value = my_time; your fi

Re: SOT: Show time in field on click

2011-01-04 Thread Russ Michaels
try this document.getElementById('myDate').value = my_time; your field must have an id of "myDate" e.g. Russ On Tue, Jan 4, 2011 at 3:27 PM, Michael Grant wrote: > > No, they refer to the name attribute. > Otherwise it's document.getElementById("myDate"). > > > On Tue, Jan 4, 2011 at 10:26

Re: SOT: Show time in field on click

2011-01-04 Thread Michael Grant
No, they refer to the name attribute. Otherwise it's document.getElementById("myDate"). On Tue, Jan 4, 2011 at 10:26 AM, Ian Skinner wrote: > > On 1/4/2011 7:16 AM, Orlini, Robert wrote: > > Still not showing when I click the button. I also tried putting my_time > into the field. > > > > RO >

Re: SOT: Show time in field on click

2011-01-04 Thread Michael Grant
ert wrote: > > Still not showing when I click the button. I also tried putting my_time > into the field. > > RO > > -Original Message- > From: "Michael Grant" > Sent: Tuesday, January 4, 2011 10:05am > To: "cf-talk" > Subject: Re: SOT: Show

Re: SOT: Show time in field on click

2011-01-04 Thread Ian Skinner
On 1/4/2011 7:16 AM, Orlini, Robert wrote: > Still not showing when I click the button. I also tried putting my_time into > the field. > > RO document.myForm.myDate.value = my_time; IIRC, I believe that those refer to the ID's of DOM elements, not names. Try changing your form to.

Re: SOT: Show time in field on click

2011-01-04 Thread Orlini, Robert
Still not showing when I click the button. I also tried putting my_time into the field. RO -Original Message- From: "Michael Grant" Sent: Tuesday, January 4, 2011 10:05am To: "cf-talk" Subject: Re: SOT: Show time in field on click Javascript is case-sensitive

Re: SOT: Show time in field on click

2011-01-04 Thread Michael Grant
; From: "Michael Grant" > Sent: Monday, January 3, 2011 3:29pm > To: "cf-talk" > 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_t

Re: SOT: Show time in field on click

2011-01-04 Thread Orlini, Robert
- From: "Michael Grant" Sent: Monday, January 3, 2011 3:29pm To: "cf-talk" 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_

Re: SOT: Show time in field on click

2011-01-03 Thread Michael Grant
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 wrote: > > Hi, > > I have this code I gleaned that will show the time as a popup when clicked. > I was