Solved

ColdFusion.navigate form submit - what am I missing

Posted on 2011-09-02
4
1,005 Views
Last Modified: 2012-05-12
Scratching my head a bit here, because virtually identical code works elsewhere on the same page - but for some reason, this block doesn't.

Code is pasted below and should be self explanatory.  The action page performs a CFQuery insert and return a single line of text.

Firebug reports the following error;

uncaught exception: ColdFusion.navigate: Form f1 not found

The cfquery insert isn't performed, and there's nothing to suggest that action page is being reached.  The page itself refreshes with the form values in the URL (almost as though the form method was missing).

 
<!--- Exists within a CFOutput Query - #rid# is set with a cfset +1 at the end of each output to generate an ID for each output row --->
<div id="o#rid#">
<form id="f#rid#">
<input type="hidden" name="productid1" value="#ID#" />
<input type="hidden" name="productid2" value="#form.productid#" />
<input type="image" src="/img/btns/btn-add.png" value="submit" onclick="ColdFusion.navigate('/products/search/a_addrelated.cfm','o#rid#','null','null','post','f#rid#')" />
</form>
</div>

Open in new window

0
Comment
Question by:RedBullLee
  • 2
  • 2
4 Comments
 
LVL 39

Expert Comment

by:gdemaria
ID: 36476088

Should be using cfform..   I would also add Name attribute:

<cfform id="f#rid#" name="f#rid#">
0
 

Author Comment

by:RedBullLee
ID: 36476105
Thanks for the very swift reply, gdemaria.

I made the suggested changes, but am experiencing the same still.

As mentioned, I'm suing virtually identical code elsewhere on the page without issue.
0
 
LVL 39

Accepted Solution

by:
gdemaria earned 500 total points
ID: 36476865
I don't see cfoutput tags, be sure your code is nested within cfoutput

Check to see if you have another form nested around this form that would prevent this form from being found.

If that doesn't work, the code you're showing doesn't have a problem, you need to post more code.
0
 

Author Comment

by:RedBullLee
ID: 36477674
Thanks gdemaria,

It was indeed wrapped around another form - I hadn't noticed the others on the page were not.  Removed the outer form tags and it works perfectly now.

Thanks for suggesting that, much appreciated!
0

Featured Post

Master Your Team's Linux and Cloud Stack!

The average business loses $13.5M per year to ineffective training (per 1,000 employees). Keep ahead of the competition and combine in-person quality with online cost and flexibility by training with Linux Academy.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

PROBLEM: How to add your own buttons to the bottom toolbar with paging info ( result count ). While creating a cfgrid, I ran into an issue where I wanted to embed my own custom buttons where the default ones ( insert / delete / etc… ) are for aes…
I spent nearly three days trying to figure out how incorporate OAuth in Coldfusion for the Eventful API. Hopefully, this article will allow Coldfusion Programmers to buzz through the API when they need to. Basically, what this script does is authori…
Although Jacob Bernoulli (1654-1705) has been credited as the creator of "Binomial Distribution Table", Gottfried Leibniz (1646-1716) did his dissertation on the subject in 1666; Leibniz you may recall is the co-inventor of "Calculus" and beat Isaac…
With Secure Portal Encryption, the recipient is sent a link to their email address directing them to the email laundry delivery page. From there, the recipient will be required to enter a user name and password to enter the page. Once the recipient …

809 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question