Download URL - http://www.phpletter.com/DOWNLOAD/
I want to extend the sample upload form with two additional fields. My
problem is I do not know how to get those additional field variables
passed in the POST process. Here is a snippet of the javascript used.
In the function ajaxFileUpload, s.fileElementId is the name of the
file to be uploaded. I can see where it is added to the form
constructed in the function createUploadForm.
How do I introduce 2 new form field names so that I can reference them
in the php file that is called by the form action method?
createUploadForm: function(id, fileElementId)
{
//create form
var formId = 'jUploadForm' + id;
var fileId = 'jUploadFile' + id;
var form = $('<form action="" method="POST" name="' + formId +
'"
id="' + formId + '" enctype="multipart/form-data"></form>');
var oldElement = $('#' + fileElementId);
var newElement = $(oldElement).clone();
$(oldElement).attr('id', fileId);
$(oldElement).before(newElement);
$(oldElement).appendTo(form);
//set attributes
$(form).css('position', 'absolute');
$(form).css('top', '-1200px');
$(form).css('left', '-1200px');
$(form).appendTo('body');
return form;
},
ajaxFileUpload: function(s) {
s = jQuery.extend({}, jQuery.ajaxSettings, s);
var id = new Date().getTime()
var form = jQuery.createUploadForm(id, s.fileElementId);
var io = jQuery.createUploadIframe(id, s.secureuri);
var frameId = 'jUploadFrame' + id;
var formId = 'jUploadForm' + id;
Thank you in advance!!!
Tim