[thelist] simple Javascript help

Drew Shiel ashiel at sportsinteraction.com
Fri Nov 1 10:05:00 CST 2002


   (The cross-browser adventure begins!)

At 09:10 01/11/2002 -0500, Joshua Olson wrote:

>What you probably want to do it hide and expose elements using css.  Each
>element on the page has a property called style.display.  Setting that
>property to "none", "block", or "inline" will affect how it's displayed.
>Play around with that and see if you can get the results you need.

   OK. What I have now is:

         <tr>
                 <td>
                         <select name="type" onChange="fnShowHide(this.value)">
                                 <option value="n">Type of Promo Tool</option>
                                 <option value="All">All</option>
                                 <option value="Banner">Banner</option>
                                 <option value="TextLink">Text Link</option>
                                 <option value="WebServices">Web
Services</option>
                                 <option value="Content">Content</option>
                         </select>
                 </td>
<script language=javascript>
<!--
function fnShowHide(param)
{
document.all.Banner.style.visibility = "hidden";
document.all.n.style.visibility = "hidden";
document.all.All.style.visibility = "hidden";
document.all.TextLink.style.visibility = "hidden";
document.all.WebServices.style.visibility = "hidden";
document.all.Content.style.visibility = "hidden";
document.all[param].style.visibility = "visible";
}
// -->
</script>

                 <td>
                                                 <div id=n
style="visibility: hidden;"></div><div id=All style="visibility:
hidden;"></div><div id=TextLink style="visibility: hidden;"></div><div
id=WebServices style="visibility: hidden;"></div><div id=Content
style="visibility: hidden;"></div>
                         <div id=Banner style="visibility: hidden;">
                         <select name=size>
                                 <option>Banner Size</option>
                                 <option>60 x 60</option>
                                 <option>120 x 60</option>
                                 <option>180 x 60</option>
                         </select>
                         </div>
                 </td>
         </tr>
         <tr>



Now, this works fine in IE, but Netscape complains about document.all not
existing.

Can this be done in Netscape?

Drew.


Drew Shiel                               webmaster at swiftpay.com
                                                     +353-1-2365705
------------------------------------------------------------------
Swiftpay -- The best way to pay online -- http://www.swiftpay.com




More information about the thelist mailing list