RE: Custom Tag w/JS functions

2000-10-27 Thread Bill Grover

I haven't had any problems with CF code between script tags.  I do it a lot.  Here are 
some code samples from the latest pages I wrote.  The first one shows how I use a CFIF 
to determine what javascript lines to return.  The 2nd function shows how I use a CF 
variable as a subscript to javascript.  I hope these help.

Bill Grover
Supervisor, IS
EU Services, Inc.
649 N Horners Ln
Rockville MD 20850

Phone:  301-424-3300 x396
FAX:301-424-3300 x1396#
E-Mail: [EMAIL PROTECTED]
WWW:www.euservices.com


- File1.cfm -









 



#APPLICATION.Title#










 




TabClick('2', '0');



TabClick('1', '0');



- FilterJava.cfm -




<!--
function ShowFilters()
{
var nMaxFilters;
var nClickAdjust;

// This is 1 less than the actual number
// Because JavaScript counts from 0

<CFIF APPLICATION.AllJobs EQ "Y">
nMaxFilters = 7;
nClickAdjust = 1;
<CFELSE>
nMaxFilters = 6;
// nClickAdjust = 2;
</CFIF>

for (var i = 0; i <= nMaxFilters; i++)
{
if (FilterForm.Filter[i].checked) 
{
FilterClick( ""  + (i + nClickAdjust) );
}
}
}

function ValidJob(toForm, toInput, tuValue)
{
var llReturn;

llReturn = true;

if (FilterForm.Filter[#APPLICATION.JobOptionIndex#].checked)
{
lcValue = AllTrim(tuValue)

if (isEmpty(lcValue))
{
llReturn = false;
}
}

return llReturn;
}
-->



--

Date: Thu, 26 Oct 2000 13:15:21 +0100
From: "Paul Johnston" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Subject: RE: Custom Tag w/JS functions
Message-ID: <002001c03f46$699c85a0$162badc0@paul>

bear in mind that no cfcode within  tags will get
processed.

To get round this, put the code into a page, and then  the code
in between to  tags:


<cfinclude template="mytemplate.cfm">



<cf_mytemplate>



Enjoy

Paul

Archives: http://www.mail-archive.com/cf-talk@houseoffusion.com/
Unsubscribe: http://www.houseoffusion.com/index.cfm?sidebarRsts or send a message with 
'unsubscribe' in the body to [EMAIL PROTECTED]



Re: RE: Custom Tag w/JS functions

2000-10-26 Thread David Shadovitz

I started this thread, and since then I've looked at a few CF/JS custom
tags, such as CF_DoubleBox.  Observations:
  * They are called from the body of a document.
  * They write HTML directly into the body.
  * They write JS  directly into the body, surrounding it with
 tags.
  * The JS includes CFML variables (example below) and CFML code:
   
document.#attributes.form#.SelectedFields#attributes.name#.options[i].sel
ected = false;

So you'd get something like this, where the output of the custom tag is
shown in UPPERCASE:





HTML CODE

JAVASCRIPT CODE

HTML CODE




I wrote my CF/JS custom tag using CFHTMLHEAD to put the JavaScript
functions into the doc's head, not into the body.

-David

On Thu, 26 Oct 2000 10:58:51 -0400 [EMAIL PROTECTED]
(Carol Bluestein) writes:
> Hi all. 
> Not sure if this is OT or not.  With respect to CF code and JS, the 
> CF tag
> THREESELECTS intertwines CF and JS inbewteen script tags.  I'd like 
> to know more
> about how this works. so I could use it in the code that I do.
> 
> Carol
> 
> Carol L. Bluestein
> Senior Programmer
> NYS Office of Real Property
> 518-486-6335
> [EMAIL PROTECTED]
> 
> ____________Reply Separator
> Subject:RE: Custom Tag w/JS functions
> Author: [EMAIL PROTECTED]
> Date:   10/26/00 2:17 PM
> 
> Do you know something, you're right.
> 
> I did some code a while back and I couldn't get CF to do what I 
> wanted in
> the javascript.  It makes sense that you should be able to.  I can't
> remember exactly what it is (I left that job) but I do remember that 
> it
> didn't work.
> 
> Oh well, I look stupid!
> 
> Thanks
> Paul
> 
> > -----Original Message-
> > From: Rob Keniger [mailto:[EMAIL PROTECTED]]
> > Sent: 26 October 2000 13:25
> > To: CF-Talk
> > Subject: Re: Custom Tag w/JS functions
> >
> > on 10/26/00 10:15 PM, Paul Johnston at 
> [EMAIL PROTECTED] wrote:
> >
> > > bear in mind that no cfcode within  tags will 
> get
> > > processed.
> >
> > Hmmm. Works fine for me, always has...
> >
> > Rob Keniger
> > big bang solutions


YOU'RE PAYING TOO MUCH FOR THE INTERNET!
Juno now offers FREE Internet Access!
Try it today - there's no risk!  For your FREE software, visit:
http://dl.www.juno.com/get/tagj.

Archives: http://www.mail-archive.com/cf-talk@houseoffusion.com/
Unsubscribe: http://www.houseoffusion.com/index.cfm?sidebar=lists or send a message 
with 'unsubscribe' in the body to [EMAIL PROTECTED]



Re:RE: Custom Tag w/JS functions

2000-10-26 Thread Carol Bluestein

Hi all. 
Not sure if this is OT or not.  With respect to CF code and JS, the CF tag
THREESELECTS intertwines CF and JS inbewteen script tags.  I'd like to know more
about how this works. so I could use it in the code that I do.

Carol

Carol L. Bluestein
Senior Programmer
NYS Office of Real Property
518-486-6335
[EMAIL PROTECTED]


Reply Separator
Subject:    RE: Custom Tag w/JS functions
Author: [EMAIL PROTECTED]
Date:   10/26/00 2:17 PM

Do you know something, you're right.

I did some code a while back and I couldn't get CF to do what I wanted in
the javascript.  It makes sense that you should be able to.  I can't
remember exactly what it is (I left that job) but I do remember that it
didn't work.

Oh well, I look stupid!

Thanks

Paul

> -Original Message-
> From: Rob Keniger [mailto:[EMAIL PROTECTED]]
> Sent: 26 October 2000 13:25
> To: CF-Talk
> Subject: Re: Custom Tag w/JS functions
>
>
> on 10/26/00 10:15 PM, Paul Johnston at [EMAIL PROTECTED] wrote:
>
> > bear in mind that no cfcode within  tags will get
> > processed.
>
> Hmmm. Works fine for me, always has...
>
> --
>
> Rob Keniger
>
> big bang solutions
>
> <mailto:[EMAIL PROTECTED]>
> <http://www.bigbang.net.au>
>
> --
> --
> Archives: http://www.mail-archive.com/cf-talk@houseoffusion.com/
> Unsubscribe: http://www.houseoffusion.com/index.cfm?sidebar=lists
> or send a message with 'unsubscribe' in the body to
> [EMAIL PROTECTED]
>




Archives: http://www.mail-archive.com/cf-talk@houseoffusion.com/
Unsubscribe: http://www.houseoffusion.com/index.cfm?sidebar=lists or send a
message with 'unsubscribe' in the body to [EMAIL PROTECTED]

Archives: http://www.mail-archive.com/cf-talk@houseoffusion.com/
Unsubscribe: http://www.houseoffusion.com/index.cfm?sidebar=lists or send a message 
with 'unsubscribe' in the body to [EMAIL PROTECTED]



RE: Custom Tag w/JS functions

2000-10-26 Thread Bill Killillay

> > > bear in mind that no cfcode within  tags will get
> > > processed.
Sure it will.

Example one: Will most likely blow up


some JS here.#somevar.foo#



Example two: Will most likely work just fine


some JS here.#somevar.foo#

See the difference?


> I did some code a while back and I couldn't get CF to do what I wanted in
> the javascript.  It makes sense that you should be able to.  I can't
> remember exactly what it is (I left that job) but I do remember that it
> didn't work.
See above.


Bill


Archives: http://www.mail-archive.com/cf-talk@houseoffusion.com/
Unsubscribe: http://www.houseoffusion.com/index.cfm?sidebar=lists or send a message 
with 'unsubscribe' in the body to [EMAIL PROTECTED]



RE: Custom Tag w/JS functions

2000-10-26 Thread Paul Johnston

Do you know something, you're right.

I did some code a while back and I couldn't get CF to do what I wanted in
the javascript.  It makes sense that you should be able to.  I can't
remember exactly what it is (I left that job) but I do remember that it
didn't work.

Oh well, I look stupid!

Thanks

Paul

> -Original Message-
> From: Rob Keniger [mailto:[EMAIL PROTECTED]]
> Sent: 26 October 2000 13:25
> To: CF-Talk
> Subject: Re: Custom Tag w/JS functions
>
>
> on 10/26/00 10:15 PM, Paul Johnston at [EMAIL PROTECTED] wrote:
>
> > bear in mind that no cfcode within  tags will get
> > processed.
>
> Hmmm. Works fine for me, always has...
>
> --
>
> Rob Keniger
>
> big bang solutions
>
> <mailto:[EMAIL PROTECTED]>
> <http://www.bigbang.net.au>
>
> --
> --
> Archives: http://www.mail-archive.com/cf-talk@houseoffusion.com/
> Unsubscribe: http://www.houseoffusion.com/index.cfm?sidebar=lists
> or send a message with 'unsubscribe' in the body to
> [EMAIL PROTECTED]
>



Archives: http://www.mail-archive.com/cf-talk@houseoffusion.com/
Unsubscribe: http://www.houseoffusion.com/index.cfm?sidebar=lists or send a message 
with 'unsubscribe' in the body to [EMAIL PROTECTED]



Re: Custom Tag w/JS functions

2000-10-26 Thread Rob Keniger

on 10/26/00 10:15 PM, Paul Johnston at [EMAIL PROTECTED] wrote:

> bear in mind that no cfcode within  tags will get
> processed.

Hmmm. Works fine for me, always has...

-- 

Rob Keniger

big bang solutions





Archives: http://www.mail-archive.com/cf-talk@houseoffusion.com/
Unsubscribe: http://www.houseoffusion.com/index.cfm?sidebar=lists or send a message 
with 'unsubscribe' in the body to [EMAIL PROTECTED]



RE: Custom Tag w/JS functions

2000-10-26 Thread Paul Johnston

bear in mind that no cfcode within  tags will get
processed.

To get round this, put the code into a page, and then  the code
in between to  tags:


<cfinclude template="mytemplate.cfm">



<cf_mytemplate>



Enjoy

Paul
> -Original Message-
> From: David Shadovitz [mailto:[EMAIL PROTECTED]]
> Sent: 25 October 2000 06:55
> To: CF-Talk
> Subject: Custom Tag w/JS functions
>
>
> I'm writing a plain CF Custom Tag which also contains some JavaScript
> functions.  I'm thinking of using CFHTMLHEAD to write the JS functions
> into the calling document's head.
>
> Any opinions as to where to write the JS functions?
>   * At whatever point the tag is called
>   * In the head via CFHTMLHEAD
>   * Other?
>
> Thanks.
> -David
> 
> YOU'RE PAYING TOO MUCH FOR THE INTERNET!
> Juno now offers FREE Internet Access!
> Try it today - there's no risk!  For your FREE software, visit:
> http://dl.www.juno.com/get/tagj.
> --
> --
> Archives: http://www.mail-archive.com/cf-talk@houseoffusion.com/
> Unsubscribe: http://www.houseoffusion.com/index.cfm?sidebar=lists
> or send a message with 'unsubscribe' in the body to
> [EMAIL PROTECTED]
>



Archives: http://www.mail-archive.com/cf-talk@houseoffusion.com/
Unsubscribe: http://www.houseoffusion.com/index.cfm?sidebar=lists or send a message 
with 'unsubscribe' in the body to [EMAIL PROTECTED]



RE: Custom Tag w/JS functions

2000-10-25 Thread Jeff Britts

What I've done is enclose the cftag in script tags


<cf_whatever>


I guess it depends on what your tag does, but give it a shot

-Original Message-
From: David Shadovitz [mailto:[EMAIL PROTECTED]]
Sent: Wednesday, October 25, 2000 1:55 AM
To: CF-Talk
Subject: Custom Tag w/JS functions


I'm writing a plain CF Custom Tag which also contains some JavaScript
functions.  I'm thinking of using CFHTMLHEAD to write the JS functions
into the calling document's head.

Any opinions as to where to write the JS functions?
  * At whatever point the tag is called
  * In the head via CFHTMLHEAD
  * Other?

Thanks.
-David

YOU'RE PAYING TOO MUCH FOR THE INTERNET!
Juno now offers FREE Internet Access!
Try it today - there's no risk!  For your FREE software, visit:
http://dl.www.juno.com/get/tagj.


Archives: http://www.mail-archive.com/cf-talk@houseoffusion.com/
Unsubscribe: http://www.houseoffusion.com/index.cfm?sidebar=lists or send a
message with 'unsubscribe' in the body to [EMAIL PROTECTED]

Archives: http://www.mail-archive.com/cf-talk@houseoffusion.com/
Unsubscribe: http://www.houseoffusion.com/index.cfm?sidebar=lists or send a message 
with 'unsubscribe' in the body to [EMAIL PROTECTED]



Custom Tag w/JS functions

2000-10-24 Thread David Shadovitz

I'm writing a plain CF Custom Tag which also contains some JavaScript
functions.  I'm thinking of using CFHTMLHEAD to write the JS functions
into the calling document's head.

Any opinions as to where to write the JS functions?
  * At whatever point the tag is called
  * In the head via CFHTMLHEAD
  * Other?

Thanks.
-David

YOU'RE PAYING TOO MUCH FOR THE INTERNET!
Juno now offers FREE Internet Access!
Try it today - there's no risk!  For your FREE software, visit:
http://dl.www.juno.com/get/tagj.

Archives: http://www.mail-archive.com/cf-talk@houseoffusion.com/
Unsubscribe: http://www.houseoffusion.com/index.cfm?sidebar=lists or send a message 
with 'unsubscribe' in the body to [EMAIL PROTECTED]