You are here: Re: select list show/hide elements: problems in IE Options « HTML « IT news, forums, messages
Re: select list show/hide elements: problems in IE Options

Posted by Neredbojias on 10/17/07 22:11

Well bust mah britches and call me cheeky, on Wed, 17 Oct 2007 22:01:29 GMT
scribed:

> I am trying to do this simple thing in html. I have a select list and
> when you click the button the first element should hide. It works
> fine
> in firefox but not in IE. I have tried all sorts of things but could
> not do it. Any help...
>
> <html>
> <body>
> <select id="pid" name="pid" multiple>
> <option id="a" value="a">a</option>
> <option id="b" value="b">b</option>
> <option id="c" value="c">c</option>
> </select>
> <input name="submit" value="Start Analysis" type="button"
> onClick="javascript:show_hide()">
> </body>
> <script type="text/javascript">
> function show_hide() {
> var a = document.getElementById("a");
> a.style.display="none";
> }
> </script>
> </html>

Get rid of this:

var a = document.getElementById("a");
a.style.display="none";

and use this instead:

document.getElementById("a").style.display="none";

Also, I presume you have a form enclosing the form elements.

--
Neredbojias
Half lies are worth twice as much as whole lies.

 

Navigation:

[Reply to this message]


Удаленная работа для программистов  •  Как заработать на Google AdSense  •  England, UK  •  статьи на английском  •  PHP MySQL CMS Apache Oscommerce  •  Online Business Knowledge Base  •  DVD MP3 AVI MP4 players codecs conversion help
Home  •  Search  •  Site Map  •  Set as Homepage  •  Add to Favourites

Copyright © 2005-2006 Powered by Custom PHP Programming

Сайт изготовлен в Студии Валентина Петручека
изготовление и поддержка веб-сайтов, разработка программного обеспечения, поисковая оптимизация