Link to home
Start Free TrialLog in
Avatar of RedBullLee
RedBullLee

asked on

ColdFusion.navigate form submit - what am I missing

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

Avatar of gdemaria
gdemaria
Flag of United States of America image


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

<cfform id="f#rid#" name="f#rid#">
Avatar of RedBullLee
RedBullLee

ASKER

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.
ASKER CERTIFIED SOLUTION
Avatar of gdemaria
gdemaria
Flag of United States of America image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
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!