Have a look at prototype etc for Observers if you want to use a JS
framework, if not you can just roll your own, not too hard, basic field
validation really.






"This e-mail is from Reed Exhibitions (Gateway House, 28 The Quadrant,
Richmond, Surrey, TW9 1DN, United Kingdom), a division of Reed Business,
Registered in England, Number 678540.  It contains information which is
confidential and may also be privileged.  It is for the exclusive use of the
intended recipient(s).  If you are not the intended recipient(s) please note
that any form of distribution, copying or use of this communication or the
information in it is strictly prohibited and may be unlawful.  If you have
received this communication in error please return it to the sender or call
our switchboard on +44 (0) 20 89107910.  The opinions expressed within this
communication are not necessarily those expressed by Reed Exhibitions." 
Visit our website at http://www.reedexpo.com

-----Original Message-----
From: Brad Wood
To: CF-Talk
Sent: Tue Dec 26 20:40:45 2006
Subject: RE: HTML focus

Yes, that would require me to have an onFocus attribute on every
element.

Basically, I have a form field, and on blur of that field, I want to
check and see where the user clicked.  If they clicked the input I
wanted them to, then fine, otherwise I want to give focus to the input I
wanted them to click.  Basically, it is a cheesy way of saying, if you
fill out field 1, then I'm going to make you fill out field 2.  The
requirement is to not let field 2 lose focus, until it is populated.
These are select dropdowns, so simply calling field2.focus() screws you
up when the user clicks it because the drop down immediately collapses
again after being clicked.

I don't know if that makes sense to anyone which is why I was hoping to
not have to explain it.  Basically, I should be able to make this work
if there is a way to test a field for focus or "ask" the document which
field has focus WITHOUT having an onFocus event on EVERY element in the
page.

~Brad 

-----Original Message-----
From: Robertson-Ravo, Neil (RX)
[mailto:[EMAIL PROTECTED] 
Sent: Tuesday, December 26, 2006 2:23 PM
To: CF-Talk
Subject: Re: HTML focus

You mean apart from onFocus?






"This e-mail is from Reed Exhibitions (Gateway House, 28 The Quadrant,
Richmond, Surrey, TW9 1DN, United Kingdom), a division of Reed Business,
Registered in England, Number 678540.  It contains information which is
confidential and may also be privileged.  It is for the exclusive use of
the
intended recipient(s).  If you are not the intended recipient(s) please
note
that any form of distribution, copying or use of this communication or
the
information in it is strictly prohibited and may be unlawful.  If you
have
received this communication in error please return it to the sender or
call
our switchboard on +44 (0) 20 89107910.  The opinions expressed within
this
communication are not necessarily those expressed by Reed Exhibitions." 
Visit our website at http://www.reedexpo.com

-----Original Message-----
From: Brad Wood
To: CF-Talk
Sent: Tue Dec 26 20:26:55 2006
Subject: HTML focus

Does and HTML element have an attribute which will tell you if it has
focus? 

 

Ex:  

If(document.getElementById('test1').focus == true)

{ ... }

 

Also, does the document object have a method which will tell you the
current focused element?

 

Ex:

var elem = Document.getFocusedElement();

alert(elem.id + ' has focus.');

 

Thanks.

 

~Brad









~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~|
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:265046
Subscription: http://www.houseoffusion.com/groups/CF-Talk/subscribe.cfm
Unsubscribe: 
http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=11502.10531.4

Reply via email to