?
Solved

ColdFusion.navigate form submit - what am I missing

Posted on 2011-09-02
4
Medium Priority
?
1,029 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 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 2000 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

New feature and membership benefit!

New feature! Upgrade and increase expert visibility of your issues with Priority Questions.

Question has a verified solution.

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

Hi, I will be creating today a basic tutorial on how we can create a Mail Custom Function and use it where ever we want. The main advantage about creating a custom function is that we can accommodate a range of arguments to pass to the Function and …
Sometimes databases have MILLIONS of records and we need a way to quickly query that table to return the results me need. Sure you could use CFQUERY but it takes too long when there are millions of records. That is why SOLR was invented. Please …
Add bar graphs to Access queries using Unicode block characters. Graphs appear on every record in the color you want. Give life to numbers. Hopes this gives you ideas on visualizing your data in new ways ~ Create a calculated field in a query: …
Sometimes it takes a new vantage point, apart from our everyday security practices, to truly see our Active Directory (AD) vulnerabilities. We get used to implementing the same techniques and checking the same areas for a breach. This pattern can re…

765 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