• Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
    Dedicated community for Japanese speakers
  • 한국 커뮤니티
    Dedicated community for Korean speakers
Exit
0

Fusebox issue

Participant ,
Jul 16, 2008 Jul 16, 2008

Copy link to clipboard

Copied

I am trying to develop in a fusebox architecture that has already been set up. I have a problem when I try to go from page1.cfm to page2.cfm. The variables, i.e. form.name, error out as, " Element NAME is undefined in FORM.". And it always returns to, "sfa=main.main" instead of "sfa="main.page2", etc.

It just won't allow any passing of variables. I am new to fusebox and very well may be missing something simple. Any help is appreciated.
TOPICS
Advanced techniques

Views

867

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Advocate ,
Jul 16, 2008 Jul 16, 2008

Copy link to clipboard

Copied

Can you let us know what version of Fusebox you're running? If it's version 5.5, do you know if it's using XML or non-XML (if it's using XML, you'll see files with the name circuit.xml or circuit.xml.cfm somewhere in the web application folder)?

As a rule, Fusebox wraps your form and url variables into a structure/collection called "attributes". So, a form field with an id or name attribute set to fname can be accessed as attributes.fname.

However, I do not believe the form scope is destroyed, so form.fname should work. Most likely, it's something in the submission. To start, could you post the form code (specifically, the form tag itself and the action and method attributes).

Cheers,
Craig

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Participant ,
Jul 16, 2008 Jul 16, 2008

Copy link to clipboard

Copied

I believe it is version 3.0 of FB and non-xml

This is the form:
<form action="addtoauction.cfm" method=post>

PIDC: <input type=text name="PIDC" size=10><input type="submit" name="SESSION.Action" value="addtoauction"> </form>

This is the circuit:

<cfscript>
fusebox.circuits.main = "dsp_mainfile.cfm";
fusebox.circuits.addtoauction = "dsp_addtoauction";
</cfscript>

This is the switch:
<cfswitch expression = "#fusebox.sfa#">

<cfcase value="main">
<cfset Heading = "auction">
<!---[BEGIN] Main's XFA(s) --->

<cfinclude template="dsp_mainfile.cfm">

</cfcase>



<cfcase value="addtoauction">
<cfset Heading = "addtoauction">
<!---[BEGIN] Main's XFA(s) --->

<cfinclude template="dsp_addtoauction.cfm">
</cfcase>


<cfcase value="fusebox.defaultfuseaction">
<!---This will be the value returned if someone types in "circuitname.", omitting the actual sfa request--->
</cfcase>





<cfdefaultcase>
<!---This will just display an error message and is useful in catching typos of sfa names while developing--->
<cfoutput>This is the cfdefaultcase tag. I received a sfa called "#attributes.sfa#" and I don't know what to do with it.</cfoutput>
</cfdefaultcase>


</cfswitch>

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Advocate ,
Jul 16, 2008 Jul 16, 2008

Copy link to clipboard

Copied

LATEST
Looking at your form, I'm not sure where the element named "name" is. There's the PIDC field and a submit (I realize that additional form code could be cut from the post, of course).

On the page called addtoauction.cfm, have you tried adding the following to the top of the page:
<cfdump var="#FORM#"/>
<cfabort/>

Apologies if you've already tried this, but, if not, it will spit out the entire form scope (or throw an error if the form scope does not, for some reason, exist). From there you can see if the form is being submitted and, if so, what values it's sending along.

I'm rusty on FB3, as it's been 4 or 5 years since I last used it and the FB core was completely overhauled with version 4. However, the only thing that caught my eye was the action attribute. It doesn't follow FB conventions and an attempt to access this page (addtoaction.cfm) in this manner would most likely result in an automatic redirect to index.cfm.

As a test, try putting addtoauction.cfm in a subdirectory (i.e., tests). Add an empty Aplication.cfm or Application.cfc file (server/preference depending) to this directory so that it includes both the App and Add to Auction files. This will prevent FB from trying to force the redirect to index.cfm and should show you the form submission details. If it works, let me know...

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Resources
Documentation