i have input type one is File type and Image type…
by onclick the Image type->it should upload the image from System and at the same it should also shows the currents change image file also.
after that by clicking on save button it should save…
k everything works fine in all browsers except IE… if i click save button in IE it doesn’t fire at all. again i need to click(so Totally 2 times i need to click the save button ) after that it will work…
i need only single click…
i will post my sample code…
<table>
<tr>
<td style=“width:560px;”>
@Html.ActionLink(" “, “Download”, new { Filename = “”, Modulename = g.Settings[i].Module }, new { id = “LinkID” + cnt })
</td>
<td>
<input type=“image” src=”~/Images/UploadFile.png" onclick=“document.getElementById(‘@cnt.ToString()’).click(); return false;” name=“image” width=“16” height=“20”/>
<input type=“file” name=“fileUploder” id= @cnt.ToString() onchange=“Savefile(this.id)” style=“visibility: hidden; width:5px; height:5px;”/>
</td>
</tr>
</table>
<script type=“text/javascript”>
function Savefile(fileuploaderid) {
var id = fileuploaderid;
var files = document.getElementById(id).files; // Getting the properties of file from file field
var filename = files[0].name;
var txtmoduleid = “TxtModule” + id;
var textmodule = $(“#” + txtmoduleid).val();
var form_data = new FormData(); // Creating object of FormData class
form_data.append(“file”, files[0]) // Appending parameter named file with properties of file_field to form_data
form_data.append(“modulename”, textmodule) // Adding extra parameters to form_data
$.ajax({
url: “Config/Upload”,
cache: false,
contentType: false,
processData: false,
data: form_data, // Setting the data attribute of ajax with file_data
type: ‘post’,
success: function (data) {
var newvalue = data;
var linkid = “LinkID” + id; //get link id
$(“#” + linkid).text(newvalue); //change link text
var textid = “TxtValId” + id; //get text id
$(“#” + textid).val(newvalue); //change text value
},
error: function (data) {
}
});
}
</script>
experts pls help me to solve this issue.