Re: SOT: Show time in field on click

2011-01-05 Thread Michael Grant
=9 input type=button value=Bounce Start Time onclick=show_now(); /form -Original Message- From: Russ Michaels r...@michaels.me.uk Sent: Tuesday, January 4, 2011 1:05pm To: cf-talk cf-talk@houseoffusion.com Subject: Re: SOT: Show time in field on click Michael, you

Re: SOT: Show time in field on click

2011-01-04 Thread Orlini, Robert
-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

Re: SOT: Show time in field on click

2011-01-04 Thread Michael Grant
=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

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 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

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. form

Re: SOT: Show time in field on click

2011-01-04 Thread Michael Grant
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

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 h...@ilsweb.com 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.

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. input type=text name=myDate id=myDate Russ On Tue, Jan 4, 2011 at 3:27 PM, Michael Grant mgr...@modus.bz wrote: No, they refer to the name attribute. Otherwise it's

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 r...@michaels.me.uk Sent: Tuesday, January 4, 2011 10:36am To: cf-talk cf-talk@houseoffusion.com Subject: Re: SOT: Show time in field on click try this document.getElementById('myDate').value = my_time

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. html head script type=text/javascript function show_now() { var my_time = new Date(); document.myForm.myDate.value = my_time; } /script /head body form name=myForm input name=myDate type=text

Re: SOT: Show time in field on click

2011-01-04 Thread Michael Grant
To: cf-talk cf-talk@houseoffusion.com 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. input type=text name=myDate id=myDate Russ On Tue, Jan 4, 2011 at 3:27 PM, Michael Grant mgr

Re: SOT: Show time in field on click

2011-01-04 Thread Orlini, Robert
4, 2011 10:36am To: cf-talk cf-talk@houseoffusion.com 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. input type=text name=myDate id=myDate Russ On Tue, Jan 4, 2011 at 3:27 PM, Michael Grant

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 =

Re: SOT: Show time in field on click

2011-01-04 Thread Michael Grant
cf-talk@houseoffusion.com 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. input type=text name=myDate id=myDate Russ On Tue, Jan 4, 2011 at 3:27 PM, Michael Grant mgr...@modus.bz wrote

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 Larry Juncker
/brBr input type=button value=Show Time onclick=show_now(); /form 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

RE: SOT: Show time in field on click

2011-01-04 Thread Larry Juncker
type=text size=20 /brBr input type=button value=Show Time onclick=show_now(); /form -Original Message- From: Larry Juncker [mailto:la...@aljcs.com] Sent: Tuesday, January 04, 2011 10:01 AM To: cf-talk Subject: RE: SOT: Show time in field on click

RE: SOT: Show time in field on click

2011-01-04 Thread Orlini, Robert
Message- From: Larry Juncker la...@aljcs.com Sent: Tuesday, January 4, 2011 11:08am To: cf-talk cf-talk@houseoffusion.com Subject: RE: SOT: Show time in field on click This edited script will show date or time, whichever you choose to display script type=text/javascript function show_now

RE: SOT: Show time in field on click

2011-01-04 Thread Larry Juncker
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. The toTimeString(); function works now. One further tweak though

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

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

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

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 mgr...@modus.bz wrote: Of course you do. We weren't talking about that

Re: SOT: Show time in field on click

2011-01-04 Thread Orlini, Robert
(); /form -Original Message- From: Russ Michaels r...@michaels.me.uk Sent: Tuesday, January 4, 2011 1:05pm To: cf-talk cf-talk@houseoffusion.com 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 Michael Grant
=show_now(); /form -Original Message- From: Russ Michaels r...@michaels.me.uk Sent: Tuesday, January 4, 2011 1:05pm To: cf-talk cf-talk@houseoffusion.com 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
OK I see. Why does Javascript have to be so sensitive with cases. Thanks. RO -Original Message- From: Michael Grant mgr...@modus.bz Sent: Tuesday, January 4, 2011 1:21pm To: cf-talk cf-talk@houseoffusion.com Subject: Re: SOT: Show time in field on click Right. But it's not the use

Re: SOT: Show time in field on click

2011-01-04 Thread Michael Grant
. Thanks. RO -Original Message- From: Michael Grant mgr...@modus.bz Sent: Tuesday, January 4, 2011 1:21pm To: cf-talk cf-talk@houseoffusion.com Subject: Re: SOT: Show time in field on click Right. But it's not the use of getElementById that fixed your code. It's the fact you

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's the fact you actually

SOT: Show time in field on click

2011-01-03 Thread Orlini, Robert
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

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 rorl...@hwwilson.com wrote: Hi, I have this code I gleaned that will show the time as a popup when