i'm trying to submit the files to a target file that will work with
them
i have tried the iframe=true parameter but without success

please help, what i'm missing


//start scrpt
var counter = 0;
function prepareForm(formname)
{
        var options = {
                        //target:        '#output'+id,   // target element(s) 
to be updated
with server response
                        beforeSubmit:  showRequest,  // pre-submit callback
                        success:       showResponse,  // post-submit callback
                        iframe: true
        };

        $('#'+formname).submit(function() {

                        if(counter > 0) return false;

                        $(this).ajaxSubmit(options);

                        $("input[type='submit']").attr("disabled","true");
                        counter++;

                        return false;
        });

        function showRequest(formData, jqForm, options)
        {
                var queryString = $.param(formData);

                return true;
        }

        // post-submit callback
        function showResponse(responseText, statusText)
        {
                alert('formid:'+formname+' status: ' + statusText + '\n
\nresponseText: \n' + responseText);
                document.location = document.location;
        }
}

//upload section
$(document).ready( function(){
                $('#AjaxFileUpload').livequery(function(){
                        $(this).MultiFile({
                                list: '#files-list',
                                max: 10,
                                min:3,
                                accept: 'gif|jpg|png',
                                STRING: {
                                                        file: '<em title="Click 
to remove" onclick="$(this).parent
().prev().click()">$file</em>',
                                                        remove: '<span 
class="ui-icon ui-icon-trash" />',
                                                }
                        })

                });

prepareForm("add_photoset");

}


//end javascript

//html

<form name="add_photoset" enctype="multipart/form-data"
id="add_photoset" method="post" action="photosetinsert.php" class="ui-
widget ui-widget-content ui-corner-all" >
        <div class="textFields">
                <input type="file" name="building_images[]" class="multi"
id="AjaxFileUpload" size="100" />
                <div id="files-list" ></div>
        </div>
        <div class="formButtons" >
                <input type="hidden" name="bid" value="<?= $bid ?>" />
                <input type="hidden" name="add" value="<?= $add?>" />
                <input type="hidden" name="photoset_submit" value="1" />
                <input type="submit" class="ui-state-default ui-corner-all" 
value="<?
=($add==1?'Add':'Apply')?>" />
                <input type="reset" value=" Reset " class="ui-state-default ui-
corner-all" />
        </div>
</form>

Reply via email to