Skip to main content
Inspiring
November 26, 2012
Question

cfform inside a cfdiv submit?

  • November 26, 2012
  • 1 reply
  • 2459 views

Hi All-

I currently have a .cfm file that has the following code:

<cfdiv bind="url:/homePageIncludes/homePageTabs.cfm?tab={tabtype}" bindonload="true" id="tabView"/>

... which seems to work fine, it calls homePageTabs.cfm which has a cfform on it. I want the cfform on this page to submit to itself without refreshing the page (which it appears to do).

My cfform code looks like this:

<cfform name="formTabs" method="post" action="/">

... and on my homePageTabs.cfm page I'm doing a cfdump to get the submitted form values but it keeps coming back empty. I need to be able to see the submit values as I have logic to build and display pages. I can see the form submitting without the entire page refreshing (exactly what I want) but can't seem to trap any values from the form submission.

When submitting a cfform to itself inside of a cfdiv, what exact values should I use for the action attribute? I'm assuming the method should be "post" and the docs said to give the form a unique name from the rest of the objects on the page. The various javascript functions (Coldfusion.ajax.submitform and coldfusion.navigate) did not work - the form simply did not submit at all, not even a flinch.  This code is on ColdFusion 8 and there are lots of posts about this but none seem to reveal those specifics about the cfform tag's attributes.

Anyone?

Thanks in advance,

Rich

    This topic has been closed for replies.

    1 reply

    BKBK
    Community Expert
    Community Expert
    November 26, 2012

    What about <cfform name="formTabs" method="post">?

    Inspiring
    November 26, 2012

    Without the action="/" the entire page surrounding the cfdiv gets replaced with the action page; the entire page actually gets replaced which is what I don't want. Anyone know what that action= value should be?

    Thanks for your input,

    Rich

    BKBK
    Community Expert
    Community Expert
    November 26, 2012

    With or without the "/", the cfdiv is designed such that, when a form page within the cfdiv area is submitted, the action page is likewise displayed within the cfdiv area. Do you wish the action page would display in the usual way, as if there were no cfdiv?