Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

onAllComplete Issue
  • Hi,

    I'm using onAllComplete, the uploader part of this works fine, but the onAllComplete seems to fire early, before any files are uploaded? Also I'm trying to send the contents of a form via e-mail confirmation. See below my code:

    <script type="text/javascript">
    $(document).ready(function() {
    $('#file_upload').uploadify({
    'uploader' : '/upload/uploadify.swf',
    'script' : '/upload/uploadify.php',
    'cancelImg' : '/upload/cancel.png',
    'folder' : '/files/<?php echo $this->getOrderId() ?>',
    'auto' : false,
    'multi' : true,
    'onAllComplete' : function(event,data) {

    document.getElementByID('artworkForm').submit(); //submit the below form!!!!

    }


    function(event,data) {
    <?php

    $to = "tom@atlantisaquatics.co.uk";
    $headers = "From: TomBigFile";
    $subject = $this->getOrderId(); // make the subject of the e-mail the folder name!
    $message = $_REQUEST['instructions'] ; //send the contents of the textarea as the message!

    mail (
    $to, $subject, $message, $headers );
    ?>
    }

    });
    });
    </script>

    <form id="artworkForm" action="" method="post">
    <h5>Upload your file(s) here</h5><b>Remember!</b> If you require a double sided print you need to supply 2 files.If you require one file repeated on both sides, please tell us this in the comments box below.<br>
    <input type="file" id="file_upload" name="file_upload" /><br><br>
    <h5>Additional Comments & Instructions</h5>
    <textarea name="instructions" rows="20" cols="80">
    Please insert any additional information regarding your order/files here!
    </textarea><br>
    </center><input onclick="$('#file_upload').uploadifyUpload()" type="button" value="Submit" /></center>
    </form>


    This just gives me major errors.

    What I want to do is upload the file, WORKING.
    Send a confirmation e-mail to me with the e-mail subject as the folder name, SORT OF WORKING
    The message in the e-mail needs to be the contents of the TEXTAREA named "instructions", NOT WORKING

    Can anyone tell me where I've gone wrong :(((

    Help!

    Cheers.