I have this jquery button click function:
$("#NextButton_ButtonCtrl").live("click", function (event) {
var i = 0;
var success = 1;
var n = $("input[type=File]").length;
alert('number of files:' + n);
$("input[type=File]").each(function () {
success = 0;
alert('for is here');
/*var labelId = "FondationLabel" + i + "_LabelCtrl";
var intitule = $("span[id=" + labelId + "]").text();
var style = $(this).attr('style');
var value = $(this).val();
if (value == "" && style == "True") {
success = 0;
$("#errorSpan").html('<span ID=errorSpan class=error-span >Merci de charger le fichier' + intitule + '</span>');
//var MPE = $find("MPE");
// MPE.show();
alert('Merci de charger le fichier' + intitule);
return false;
}
i = i + 1;*/
});
alert(success);
if (success == 0) {
event.preventDefault();
return false;
}
the problem is when testing with ie :
var n = $("input[type=File]").length;
alert('number of files:' + n);
i get 0,chrom 4 (correct)
try a lowercase file
$("input[type=file]").lengthas oppose to FileReference from sitepoint.com
http://reference.sitepoint.com/css/attributeselector
UPDATE SECOND QUESTION
UPDATE 2
http://msdn.microsoft.com/en-us/library/985bhaz6.aspx
please check this how to add attributes, I’m not familiar with it but I think/hope this would work
writer.AddAttribute("data-style", "true");