Using jQuery can do what you're looking for.
www.jquery.com
Here's some code:
http://commadelimited.com/uploads/focus/
Click any of the form fields and you'll get an alert message.
Here's the actual jQuery code:
$(document).ready( function(){
$('input, select, textarea').click( function() {
alert("I'm the " + $(this).name() + " form field");
});
});
Which basically says "put a click function on every input, select or
textarea object", then run an alert message when that object is clicked.
Just change the alert message to whatever you want to happen and you're
golden.
<!----------------//------
andy matthews
web developer
certified advanced coldfusion programmer
ICGLink, Inc.
[EMAIL PROTECTED]
615.370.1530 x737
--------------//--------->
-----Original Message-----
From: Brad Wood [mailto:[EMAIL PROTECTED]
Sent: Wednesday, December 27, 2006 10:13 AM
To: CF-Talk
Subject: RE: HTML focus
You are correct that the onblur is for the element which I just left,
but that information does not help me. I need to know the element that
NOW has the focus.
I tested with alerts and when I click (with mouse) on the element with
the onblur and then on the element with the onfocus, the onfocus does in
fact run BEFORE the onblur, but like I said, if I set any variables in
the onfocus they are NOT available to the onblur when it runs. I will
see if I can put up a sample of what the heck I am talking about. :)
~Brad
-----Original Message-----
From: Robertson-Ravo, Neil (RX)
[mailto:[EMAIL PROTECTED]
Sent: Wednesday, December 27, 2006 9:59 AM
To: CF-Talk
Subject: Re: HTML focus
But onBlur is indeed for the element so whatever onBlur fires is
guaranteed
to be for the element you just left AFAIK :-).
What do you get if you alert onBlur the element value? Does it fire
before
the focus? How are you changing focus? TAB or Mouse? I am pretty sure
that
an onFocus should not fire before an onBlur.
I am not sure what you are doing now on onBlur or how you are changing
values etc (event handlers, key input). You got any code you can post
either
here or online?
Remember that there is more than one way to skin a cat so to speak! You
may
find a good one, you may roll your own which is even better!
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~|
Create robust enterprise, web RIAs.
Upgrade & integrate Adobe Coldfusion MX7 with Flex 2
http://ad.doubleclick.net/clk;56760587;14748456;a?http://www.adobe.com/products/coldfusion/flex2/?sdid=LVNU
Archive:
http://www.houseoffusion.com/groups/CF-Talk/message.cfm/messageid:265084
Subscription: http://www.houseoffusion.com/groups/CF-Talk/subscribe.cfm
Unsubscribe:
http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=11502.10531.4