Skip to main content
Fernis
Inspiring
December 1, 2007
Answered

How to POST FORM within CFWINDOW?

  • December 1, 2007
  • 1 reply
  • 973 views
Can anyone point me to the right track, since I have difficulties learning the new AJAX UI things...

I'm trying to submit a form which is located in a CFWINDOW popup. Whenever I hit the submit button, I get a CF debug error: "error: http: Error retrieving markup for element Window1_body : Not Found". The popup content reloads with the HTTP server's 404 not found message. I'm running CF8 and IIS 7 on Windows Server 2003.

I must be doing something fundamentally very wrong, right? The test.cfm does exist, and it doesn't help if I replace with an absolute URL.
-
    This topic has been closed for replies.
    Correct answer Fernis
    You are absolutely right. That attribute was left in the code by accident, as I was evaluating all different, even desperate tricks. Unfortunately removing the attribute doesn't make it work with the submit-type field. Even the <html> and <body> tags within cfwindow are extraneous - I think, but removing those won't make a difference either.
    Solved the issue.

    In an asynchronously posted form (or a cfform in general) you can't have a form field the name of which is "action". This is probably a reserved CF keyword, and the reason why it shouldn't be used... I don't know but that's gotta be the case.

    This is surely something that can be hard to remember, since I have been writing thousands of hidden "action" fields in forms within the past 15 years.

    1 reply

    December 3, 2007
    Your form needs to be in a valid XHTML format for CF to read it. That includes everything from the <html> tag right down to the </html>... including closing your input tags: <input type="..." />
    Fernis
    FernisAuthor
    Inspiring
    December 3, 2007
    Thanks, that advice helped quite a bit. Got my forms working now within a CFDIV or CFWINDOW.

    However, I haven't been able to use <cfinput type="submit"> - that always gives me the 404 error despite of what I try. As I'm a total beginner with advanced AJAX UI features, I don't know if it should even work. But using <cfinput type="button" onclick="ColdFusion.navigate.... works fine, and gets the same job done.