RE: Highlight Script

2001-09-26 Thread Ron Hornbaker

Peter,

Great script, but it left me wondering about users (like me) who don't
click on form elements after the first one. A little more embedded code,
and a little less  code, and you can make it work when tabbing
through the fields, too:

<script language="JavaScript1.2">
//Highlight form element- © Dynamic Drive (www.dynamicdrive.com)
//Modified by Humankind Systems (<A  HREF="http://hksi.net/">http://hksi.net/</A>) to work when
//tabbing through the fields.
//For full source code, 100's more DHTML scripts, and TOS,
//visit <A  HREF="http://www.dynamicdrive.com">http://www.dynamicdrive.com</A>
var highlightcolor="lightyellow"
// Only works in IE4+ and NS6+, so sniff out NS4 to prevent errors
var highlightableBrowser = document.getElementById || document.all
//Function to highlight form element
function on(e){
  if (highlightableBrowser)
e.style.backgroundColor=highlightcolor
}
function off(e){
  if (highlightableBrowser)
e.style.backgroundColor=''
}



1
2
3
4



Ron Hornbaker
President/CTO
  .  .  .  .  .  .  .  .  .  .  .  .  http://humankindsystems.com
  .  .  .  .  .  .  .  .  .  .  .  .  w e  c o d e.  w e  c a r e.




> -Original Message-
> From: Tilbrook, Peter [mailto:[EMAIL PROTECTED]]
> Sent: Wednesday, September 26, 2001 7:22 PM
> To: CF-Talk
> Subject: RE: Highlight Script
>
>
> Try this:
>
> 
> //Highlight form element- © Dynamic Drive (www.dynamicdrive.com)
> //For full source code, 100's more DHTML scripts, and TOS,
> //visit <A  HREF="http://www.dynamicdrive.com">http://www.dynamicdrive.com</A>
>
> var highlightcolor="lightyellow"
>
> var ns6=document.getElementById&&!document.all
> var previous=''
> var eventobj
>
> //Regular expression to highlight only form elements
> var intended=/INPUT|TEXTAREA|SELECT|OPTION/
>
> //Function to check whether element clicked is form element
> function checkel(which){
> if (which.style&&intended.test(which.tagName)){
> if (ns6&&eventobj.nodeType==3)
> eventobj=eventobj.parentNode.parentNode
> return true
> }
> else
> return false
> }
>
> //Function to highlight form element
> function highlight(e){
> eventobj=ns6? e.target : event.srcElement
> if (previous!=''){
> if (checkel(previous))
> previous.style.backgroundColor=''
> previous=eventobj
> if (checkel(eventobj))
> eventobj.style.backgroundColor=highlightcolor
> }
> else{
> if (checkel(eventobj))
> eventobj.style.backgroundColor=highlightcolor
> previous=eventobj
> }
> }
> 
>
>
> Your CFFORM tag should look something like this:
>
>  enctype="multipart/form-data"  passthrough="onClick='highlight(event)
> '">
> 
>
> Cheers!
>
> Peter Tilbrook
> ColdFusion Applications Developer
> Australia New Zealand Food Authority
> Boeing House
> 55 Blackall Street
> BARTON ACT 2600
> Ph: +61-2-6271-2671
> Fax: +61-2-6271-2278
>
> http://www.anzfa.gov.au
>
>
>
> **
>
> This transmission is intended only for the use of the addressee(s)
> and may contain confidential or legally privileged information.
> If you are
> not the intended recipient, you are notified that any use or
> dissemination
> of this communication is strictly prohibited. If you have received this
> transmission in error, please notify the ANZFA IT helpdesk
> prior to deleting
> all copies of this transmission together with any attachments.
>
> ANZFA helpdesk:
>
> E-mail:  [EMAIL PROTECTED]
> This footnote also confirms that this email message has been swept by
> MIMEsweeper for the presence of computer viruses.
>
> www.mimesweeper.com
> 
~~
Your ad could be here. Monies from ads go to support these lists and provide more 
resources for the community. http://www.fusionauthority.com/ads.cfm
FAQ: http://www.thenetprofits.co.uk/coldfusion/faq
Archives: http://www.mail-archive.com/cf-talk@houseoffusion.com/
Unsubscribe: http://www.houseoffusion.com/index.cfm?sidebar=lists



Re: Highlight Script

2001-09-26 Thread Mike Tangorre

Neat!  :-)


- Original Message -
From: "Tilbrook, Peter" <[EMAIL PROTECTED]>
To: "CF-Talk" <[EMAIL PROTECTED]>
Sent: Wednesday, September 26, 2001 8:22 PM
Subject: RE: Highlight Script


> Try this:
>
> 
> //Highlight form element- © Dynamic Drive (www.dynamicdrive.com)
> //For full source code, 100's more DHTML scripts, and TOS,
> //visit <A  HREF="http://www.dynamicdrive.com">http://www.dynamicdrive.com</A>
>
> var highlightcolor="lightyellow"
>
> var ns6=document.getElementById&&!document.all
> var previous=''
> var eventobj
>
> //Regular expression to highlight only form elements
> var intended=/INPUT|TEXTAREA|SELECT|OPTION/
>
> //Function to check whether element clicked is form element
> function checkel(which){
> if (which.style&&intended.test(which.tagName)){
> if (ns6&&eventobj.nodeType==3)
> eventobj=eventobj.parentNode.parentNode
> return true
> }
> else
> return false
> }
>
> //Function to highlight form element
> function highlight(e){
> eventobj=ns6? e.target : event.srcElement
> if (previous!=''){
> if (checkel(previous))
> previous.style.backgroundColor=''
> previous=eventobj
> if (checkel(eventobj))
> eventobj.style.backgroundColor=highlightcolor
> }
> else{
> if (checkel(eventobj))
> eventobj.style.backgroundColor=highlightcolor
> previous=eventobj
> }
> }
> 
>
>
> Your CFFORM tag should look something like this:
>
>  enctype="multipart/form-data"  passthrough="onClick='highlight(event)
> '">
> 
>
> Cheers!
>
> Peter Tilbrook
> ColdFusion Applications Developer
> Australia New Zealand Food Authority
> Boeing House
> 55 Blackall Street
> BARTON ACT 2600
> Ph: +61-2-6271-2671
> Fax: +61-2-6271-2278
>
> http://www.anzfa.gov.au
>
>
>
> **
>
> This transmission is intended only for the use of the addressee(s)
> and may contain confidential or legally privileged information. If you are
> not the intended recipient, you are notified that any use or dissemination
> of this communication is strictly prohibited. If you have received this
> transmission in error, please notify the ANZFA IT helpdesk prior to
deleting
> all copies of this transmission together with any attachments.
>
> ANZFA helpdesk:
>
> E-mail:  [EMAIL PROTECTED]
> This footnote also confirms that this email message has been swept by
> MIMEsweeper for the presence of computer viruses.
>
> www.mimesweeper.com
> 
~~
Get the mailserver that powers this list at http://www.coolfusion.com
FAQ: http://www.thenetprofits.co.uk/coldfusion/faq
Archives: http://www.mail-archive.com/cf-talk@houseoffusion.com/
Unsubscribe: http://www.houseoffusion.com/index.cfm?sidebar=lists



RE: Highlight Script

2001-09-26 Thread Tilbrook, Peter

Try this:


//Highlight form element- © Dynamic Drive (www.dynamicdrive.com)
//For full source code, 100's more DHTML scripts, and TOS,
//visit http://www.dynamicdrive.com

var highlightcolor="lightyellow"

var ns6=document.getElementById&&!document.all
var previous=''
var eventobj

//Regular expression to highlight only form elements
var intended=/INPUT|TEXTAREA|SELECT|OPTION/

//Function to check whether element clicked is form element
function checkel(which){
if (which.style&&intended.test(which.tagName)){
if (ns6&&eventobj.nodeType==3)
eventobj=eventobj.parentNode.parentNode
return true
}
else
return false
}

//Function to highlight form element
function highlight(e){
eventobj=ns6? e.target : event.srcElement
if (previous!=''){
if (checkel(previous))
previous.style.backgroundColor=''
previous=eventobj
if (checkel(eventobj))
eventobj.style.backgroundColor=highlightcolor
}
else{
if (checkel(eventobj))
eventobj.style.backgroundColor=highlightcolor
previous=eventobj
}
}



Your CFFORM tag should look something like this:




Cheers!

Peter Tilbrook
ColdFusion Applications Developer
Australia New Zealand Food Authority
Boeing House
55 Blackall Street
BARTON ACT 2600
Ph: +61-2-6271-2671
Fax: +61-2-6271-2278

http://www.anzfa.gov.au



**

This transmission is intended only for the use of the addressee(s)
and may contain confidential or legally privileged information. If you are
not the intended recipient, you are notified that any use or dissemination
of this communication is strictly prohibited. If you have received this
transmission in error, please notify the ANZFA IT helpdesk prior to deleting
all copies of this transmission together with any attachments.

ANZFA helpdesk:

E-mail:  [EMAIL PROTECTED]
This footnote also confirms that this email message has been swept by
MIMEsweeper for the presence of computer viruses.

www.mimesweeper.com
~~
Structure your ColdFusion code with Fusebox. Get the official book at 
http://www.fusionauthority.com/bkinfo.cfm
FAQ: http://www.thenetprofits.co.uk/coldfusion/faq
Archives: http://www.mail-archive.com/cf-talk@houseoffusion.com/
Unsubscribe: http://www.houseoffusion.com/index.cfm?sidebar=lists



RE: Highlight Script

2001-09-26 Thread Duane Boudreau

All you have to do is replace 



with



Duane

-Original Message-
From: Rich Tretola [mailto:[EMAIL PROTECTED]]
Sent: Wednesday, September 26, 2001 4:35 PM
To: CF-Talk
Subject: Highlight Script


Does anyone know of a script that will work on a  tag like this one
that works on regular form tags?
http://www.dynamicdrive.com/dynamicindex11/highlightform.htm

Thansk,
Rich

~~
Get the mailserver that powers this list at http://www.coolfusion.com
FAQ: http://www.thenetprofits.co.uk/coldfusion/faq
Archives: http://www.mail-archive.com/cf-talk@houseoffusion.com/
Unsubscribe: http://www.houseoffusion.com/index.cfm?sidebar=lists



RE: Highlight Script

2001-09-26 Thread Dave Watts

> Does anyone know of a script that will work on a  tag 
> like this one that works on regular form tags?
> http://www.dynamicdrive.com/dynamicindex11/highlightform.htm

I haven't tried using this script specifically, but you should be able to
use it with CFFORM by simply using the PASSTHROUGH attribute to pass the
ONCLICK event handler information:



Dave Watts, CTO, Fig Leaf Software
http://www.figleaf.com/
voice: (202) 797-5496
~~
Structure your ColdFusion code with Fusebox. Get the official book at 
http://www.fusionauthority.com/bkinfo.cfm
FAQ: http://www.thenetprofits.co.uk/coldfusion/faq
Archives: http://www.mail-archive.com/cf-talk@houseoffusion.com/
Unsubscribe: http://www.houseoffusion.com/index.cfm?sidebar=lists