ArunKumarS
05-06-2009, 10:10 AM
Hi all,
I am trying to create an input element of type file using the javascript. I am able to create it but the problem i am facing is, i need to apply a CSS class to the control. Can some one let me know how to do the same.
I am pasting the code that i am using to create a control.
function AddUploadFile()
{
var newrow = document.getElementById("files_tbl").insertRow(document.getElementById("files_tbl").rows.length);
var td1 = newrow.insertCell(0);
var hiddenFile = document.createElement("input");
hiddenFile.id = "File" + document.getElementById("files_tbl").rows.length;
hiddenFile.name = "File" + document.getElementById("files_tbl").rows.length;
hiddenFile.type = "file";
hiddenFile.className = "uploadtool";
hiddenFile.runat = "server";
td1.appendChild(hiddenFile);
}
Thanks & Regards,
Arun :)
I am trying to create an input element of type file using the javascript. I am able to create it but the problem i am facing is, i need to apply a CSS class to the control. Can some one let me know how to do the same.
I am pasting the code that i am using to create a control.
function AddUploadFile()
{
var newrow = document.getElementById("files_tbl").insertRow(document.getElementById("files_tbl").rows.length);
var td1 = newrow.insertCell(0);
var hiddenFile = document.createElement("input");
hiddenFile.id = "File" + document.getElementById("files_tbl").rows.length;
hiddenFile.name = "File" + document.getElementById("files_tbl").rows.length;
hiddenFile.type = "file";
hiddenFile.className = "uploadtool";
hiddenFile.runat = "server";
td1.appendChild(hiddenFile);
}
Thanks & Regards,
Arun :)