Hello , I am having an iframe inside a page , in the iframe i am having an image and on that image am adding a new upload file , but the problem is that the file chosen from the browse button isnt being sent with the form , this is the animation function n this is my code
(function ($) {
var defaults = {
rowSpeed: 1000,
newRow: null,
addTop: true,
removeTop: true
};
var newClasses = "newRow"
var options = $.extend(defaults, options);
$.fn.addRow = function (options) {
opts = $.extend(defaults, options);
var $table = $(this);
var $tableBody = $("tbody", $table);
var t = $(opts.newRow).find("td").wrapInner("<div style='display:none;'/>").parent()
if (opts.addTop) t.appendTo($tableBody);
else t.prependTo($tableBody);
t.attr("class", newClasses).removeAttr("id").show().find("td div").slideDown(options.rowSpeed, function () {
$(this).each(function () {
var $set = jQuery(this);
$set.replaceWith($set.contents());
}).end()
})
return false;
};
$.fn.removeRow = function (options) {
opts = $.extend(defaults, options);
var $table = $(this);
var t
if (opts.removeTop) t = $table.find('tbody tr:last')
else t = $table.find('tbody tr:first');
t.find("td")
.wrapInner("<div style='DISPLAY: block'/>")
.parent().find("td div")
.slideUp(opts.rowSpeed, function () {
$(this).parent().parent().remove();
});
return false;
};
return this;
})(jQuery);
my code :
/*Function for adding uploads*/
//Initializing counter to zero
var uploadsCounter = 1;
//Setting number of maximum allowed uploads.
var allowedUploads = 3
//Setting table name
var tableName = '#tableUploads';
function addUploadRow(addImage) {
//Adding 1 to the uploads counter , we'll only have
uploadsCounter++;
addImage.hide();
if (uploadsCounter > allowedUploads) {
return false;
}
else {
if (uploadsCounter < allowedUploads) {
$(tableName).addRow({ newRow: "<tr><td><input id='fileUpload" + uploadsCounter + "'runat='server' type='file' style='width: 90%' /><img id='imgAddUpload" + uploadsCounter + "' alt='add upload' src='../img/add.png' style='vertical-align: middle;cursor: hand;' /></td></tr>" });
$("#" + "imgAddUpload" + uploadsCounter).click(function () { addUploadRow($("#" + "imgAddUpload" + uploadsCounter)) });
}
else {
$(tableName).addRow({ newRow: "<tr><td><input id='fileUpload" + uploadsCounter + "'runat='server' type='file' style='width: 90%' /></td></tr>" });
}
}
}
/*Function for adding uploads*/
It's adding fine but the file isnt being sent by the form!