Hi All,
I have a page that uses cfwindow to bring up a form (CF8). When the user submits the form, I want the results to come up in the cfwindow, however, instead, it brings up the page in the regular browser window, and I can’t figure out what I’m missing. I thought that cfwindow automatically submits any forms that it contains asynchronously, but that’s not happening.
Here is the code that calls the window:
<cfwindow initShow="false"
title="Estimate Shipping and Taxes"
name="calcwin"
center="true" height="400" width="600">
<cfinclude template=”calcship.cfm”>
</cfwindow>
This is called from a link in a “regular” page: <a href="javascript:ColdFusion.Window.show('calcwin');">
Calcship.cfm displays the content based on the step passed in. When no step is passed in, the first form comes up when the link is fixed, and comes up correctly as a cfwindow. Here is the relevant code in calcship.cfm (dumbed down a bit)
<cfif step eq “”>
<cfform name="addrform" method="post" action="calcship.cfm">
<cfinput type=”hidden” name=”step” value=”2”>
<p class="instructions">Enter the number of addresses your order will be shipped to * </p>
<p class="fields">Number of Shipping Addresses:
<cfinput type="Text" name="numShip" value="1" /></p>
<cfinput name="submit" type="submit" value=”Continue” />
</cfform>
<cfelseif step eq 2>
[Code to process, and bring up form 2, etc….]
<cfelse>
Etc…
</cfif>
When this first form is submitted, it closes the window and calcship.cfm opens the second form in the regular browser window. I want it to remain in the cfwindow, and process the code based on “step=2”. I’m sure I’m missing something simple, but I’ve spent way too long trying to figure it out…
What am I missing?
Thanks,
Kristin
If the page that loads the <cfwindow> tag doesn't have any <cfform>
tags then you probably need to add <cfajaximport tags="cfform"> see:
http://cfdocs.org/cfajaximport can you test to see if any cfform
features work (such as validation)?
If that doesn't work try adding a <cfdiv> around your <cfform> (make
sure that is also imported with cfajaximport.
--
Pete Freitag - Adobe Community Professional
http://foundeo.com/ - ColdFusion Consulting & Products
http://petefreitag.com/ - My Blog
http://hackmycf.com - Is your ColdFusion Server Secure?
> --
> You received this message because you are subscribed to the Google Groups
> "Central New York ColdFusion Users Group" group.
> To post to this group, send email to cfu...@googlegroups.com.
> To unsubscribe from this group, send email to
> cfugcny+u...@googlegroups.com.
> For more options, visit this group at
> http://groups.google.com/group/cfugcny?hl=en.
>
I did actually have the cfajaximport tag, and had tried the cfdiv as well
- but your email prompted me to take a closer look at it - I'm on a beta
server, and a awhile back when I couldn't get seem to make the scripts
folder accessible to the beta site, I copied the ajax folder over to where
the beta site could access it - but didn't copy over the cfform scripts.
I just copied those over, and it works! Hurray!
Thanks for your help!
Kristin