> I'd like to setup a CFINCLUDE that dynamically populates.. something like:
>
> <CFINCLUDE TEMPLATE="#var#>
>
> This would go to fill a <DIV> component with HTML that explains the
> selection they are making..
<snip>

> have the <div><CFINCLUDE TEMPLATE="finder.cfm?#var#> </div>
>
> And have the finder.cfm basically turn the var field into the HTML to load
> where finder.cfm ends up starting a second spawn of <CFINCLUDE> with the
> proper file selected ... the problem is turning the image map variables,
or
> just a Javascript feed into the #var#

It sounds like you're having trouble differentiating between client side
code and server side code.  CF is server side, which means that CF
statements are evaluated BEFORE the page gets sent to the browser.  User
requests page -> CF server evaluates CF code and creates a simple HTML
document -> HTML document is sent to user.  Once the browser receives the
HTML no more CF code will run unless you request another page from the
server.

You can not invoke any CF tags such as CFINCLUDE once the page has been sent
to the browser, so you're going to have to find another way of doing what
you want.

Based upon your application specs there are a couple of ways you can do
this.  They all require some level of JavaScript support by the browser.

1) Each time the user makes a selection you could reload the page to show
the info about their selection, but this is a pretty nasty way to go.
However, it requires no special client side scripting and will work in all
browsers.

2) You could create a series of overlapping layers where each layer contains
the info for one of the possible selections.  Each time the user clicks on a
selection you could make the relevant layer to the "highest" on the stack,
thereby making it visible.  This should work in both Netscape and IE (4.x+
versions) but has two disadvantages: first, you would have to include the
info for all possible selections as hidden layers.  This could result in the
document becoming relatively large and therefore a long download.  Secondly,
the HTML code itself could get a little ugly with all of the overlapped
layers.

3) If you are targeting an IE 4.x+ audience only you can use the DIV's
.innerHTML or .innerText properties to dynamically rewrite the contents of
the DIV tag.  This is far easier to do then the layer method but only works
on IE 4 and up.

4) You could use frames in such a way that each time the user makes a
selection a frame updates to show the info for that selection.  This will
work in all frame aware browsers and is better than option 1 because only a
small portion of the page reloads each time the user makes a selection.

Hope this helps,
Seth Petry-Johnson
Argo Enterprise and Associates
Using
<div><CFINCLUDE TEMPLATE="finder.cfm?#var#> </div>

will result in a DIV section containing the output of finder.cfm, but

------------------------------------------------------------------------------
Archives: http://www.eGroups.com/list/cf-talk
To Unsubscribe visit 
http://www.houseoffusion.com/index.cfm?sidebar=lists&body=lists/cf_talk or send a 
message to [EMAIL PROTECTED] with 'unsubscribe' in the body.

Reply via email to