Forum Moderators: open
get a browser sniffer code to work which browser and user code similer in teh function to what i have and this should work
try this in ie and it works fine
<html>
<head>
<script language="JavaScript">
<!--
function off(){
//need broswer sniffer so
//if (ie){
mydiv.style.visibility='hidden';
// } else{ //netscape code below
// document.mydiv.visibility='hidden';//I can't remember the netscape layer code google will help ;)
//}
}
function on(){
//if (ie){//etc
mydiv.style.visibility='visible';
}
//-->
</script>
</head>
<body>
<div id="mydiv">
<select name="something">
<option value="1">first</option>
<option value="2">second</option>
</select>
</div>
<br/><br/><br/><br/><br/>
<a href="javascript:on();">On</a><br>
<a href="javascript:off();">Off</a>
</body>
</html>
document.mydiv.visibility='hidden';
That style is only for Netscape 4 (1% ish now)
..and the property for Netscape 4 is
"hide", not "hidden". You'll need to use the
[color=brown]display[/color] property anyway, else space will still be taken up. I take it that you don't actually need to remove the elements. Come to think of it, if this is a scripted dropdown, then it's simply a matter of nullifying the event handler(s) that trigger it.
Is it possible to see the relevant code?
- Javascript used for menu
- HTML for menu (after it has been processed by PHP)
cant post after its been processed by PHP, as those are simply hidden form fields, the menu is dynamic (one is hardcoded, others get added by clicking the following button, into a div with id 'container')
and since its javascript, only one menu will ever show up in the source code ;)
<input type="button" value="+" onClick="genreAdd()" title="add genre" class="postbuttons">
I want to remove the exact same menu as one can insert with + button
It's worth pointing out that strict browsers in the strictest XHTML mode only obey innerHTML as a read-only property.
Isn't it possible to have the PHP write the SELECT and all the OPTIONs, and set its display to 'none'? Switching the display would be much simpler.
If you know a way I can dynamically submit this form with - 1 to unknown- nr of genres, I'd like to hear it. And it needs to be able to be added dynamically via a button, as I do know