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:
>
> <script language="JavaScript1.2">
> //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
> }
> }
> </script>
>
>
> Your CFFORM tag should look something like this:
>
> <cfform name="applicationform" method="post" action="index.cfm"
> enctype="multipart/form-data"  passthrough="onClick='highlight(event)
> '">
> <input type="hidden" name="fuseaction" value="SubmitApplication">
>
> 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/[email protected]/
Unsubscribe: http://www.houseoffusion.com/index.cfm?sidebar=lists

Reply via email to