Skip to main content
January 16, 2010
Question

(cf9) Coldfusion.Ajax.submitForm 'does nothing'...

  • January 16, 2010
  • 1 reply
  • 460 views

I'm using cffileupload, and calling the following javascript function with the 'onuploadcomplete', here's the cffileupload code:

<cffileupload
    addbuttonlabel = "#request.uiTextBrowse#"
    align = "center"
    bgcolor = "blue"
    clearbuttonlabel = "#request.uiTextClear#"
    deletebuttonlabel = "#request.uiTextDelete#"
    extensionfilter = "#l_fileExt#"
    hideUploadButton = "false"
    maxfileselect = "#session.fileUpload.maxFiles#"
    maxuploadsize = "#session.fileUpload.maxSize#"
    name = "fileUploader"
url = "#homeDir#/member/utilities/files/act_uploadFiles.cfm"
    progressbar = "true"
    stoponerror = "true"
    title = "#session.fileUpload.Title#"
    uploadbuttonlabel = "#request.uiTextUpload#" 
    width = "400"
onerror = "uploadError"
oncomplete = "uploadComplete"
onuploadcomplete = "uploadFinished"
/>

function uploadFinished(){
alert('in uploadedFinished');
Coldfusion.Ajax.submitForm('filesToUploadForm','#homeDir#/member/utilities/files/act_processUploadedFiles.cfm',uploadProcessed, uploadProcessedError);

After checking about abazillion times I'm convinced I've got everything spelled correctly.  The url is correct (checked 'viewsource'). The callback and error javascript functions:

function uploadProcessed(rtnText){
  alert("in uploadPorcessed, text returned: ");
}
function uploadProcessedError(code, msg)
    {
        alert("Error!!! " + code + ": " + msg);
    }

The upload works fine, files are uploaded.  I know I'm getting into the uploadFinished as I get the alert which is directly in front of the Coldfusion.Ajax.Submit call.  But after that alert, nothing.  No error, nothing.  Any ideas what are some common causes of behavior (or better, 'lack of' behavior) like that?  The '#homeDir#/member/utilities/files/act_processUploadedFiles.cfm' file is in the same directory as the template being processed, but I can't find much about whether the full path is needed.  If I just use 'act_processUploadedFiles.cfm'' I get the same (lack of) behavior.

    This topic has been closed for replies.

    1 reply

    January 16, 2010

    Hmmmm...

    The ColdFusion Fairy visited me last night, and left a working ColdFusion.Ajax.submitForm call under my pillow...

    In other words, it works this morning, and I don't know what I did to fix it!!!!