how_now() {
> > var my_time = new Date();
> > document.getElementById('myDate').value = my_time.toLocaleTimeString();
> > }
> >
> >
> >
> >
> >
> >
> >
> > -Original Message-
> > From: "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
>
> 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
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
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
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
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
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
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
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,
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
();
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
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
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
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
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
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_
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.
>
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
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
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
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
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
>
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
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.
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
; 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
-
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_
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
29 matches
Mail list logo