Need help extending AjaxFileUpload Plugin with JQuery

B

Big Moxy

This plugin can be downloaded from http://www.phpletter.com/DOWNLOAD/.
I want to add 2 fields to the sample form but do not know how. The
variable s.fileElementId in the function ajaxFileUpload below is the
name of the file to be uploaded. I can see where it is added to the
form in the createUploadForm.

Can someone please show me how to add 2 fields to this form so that I
can use it in the php script called by the form action method?

Thank you!!
Tim


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) {
// TODO introduce global settings, allowing the client to
modify them for all requests, not only timeout
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);
 
P

Peter Michaux

[snip regarding jQuery plugin]

Most of the regular contributors to comp.lang.javascript recommend
against using big general purpose libraries like jQuery and Prototype.
If you search the group archives you will see many posts that question
the quality of the code. However if you are locked in then questions
specific to jQuery will likely receive better answers from the jQuery
group.

http://docs.jquery.com/Discussion

Peter
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,769
Messages
2,569,580
Members
45,054
Latest member
TrimKetoBoost

Latest Threads

Top