Forum Moderators: open

Message Too Old, No Replies

hiding an input 'file' in a DIV tag

         

quali73

12:37 pm on Sep 24, 2008 (gmt 0)

10+ Year Member



hello,

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.

Fotiman

3:04 pm on Sep 24, 2008 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member Top Contributors Of The Month



You're missing a closing quote on your 'uploader' div (after style="display:none;). Insert your missing quote and that should fix it. :)