Forum Moderators: open
I need to hide an INPUT FILE when a link is clicked on. I have used DIV tags as they should work on all browsers...
Here is the code I use:
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"><html>
<head>
<title>Untitled</title>
<script>
function toggle_div(divname){
var divname1 = document.getElementById(divname);
if (divname1.style.display == ''){
divname1.style.display = 'none';
}else {
divname1.style.display = '';
}
}
</script>
</head>
<body>
<a href="javascript:void(0);" onclick="toggle_div('uploader')">www</a>
<div id="uploader" style="display:none;>
<input name="file" type="file" /> <input name="upload" value="Upload" type="submit" />
</div>
</body>
</html>
There is something definitely wrong here as only the 'upload' button is made visible.