SitePoint Sponsor

User Tag List

Results 1 to 3 of 3

Hybrid View

  1. #1
    SitePoint Member
    Join Date
    Feb 2001
    Location
    Lisboa - Portugal
    Posts
    8
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Hi all

    I'm trying do build a page that shows or hide a layer , every time i select a radio button.

    Inside that layer I've got a table, and in one of the cells I've got a select box. Everything works ok in IE, but in netscape 4.7 the select box doesn't appear... How can I'solve this problem?


    TIA

    Lara

  2. #2
    Irritability Defined
    Join Date
    Jul 2000
    Location
    80,000 feet below the surface
    Posts
    1,442
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Welcome aboard Lara! Great to have you here.

    Can we get a code example? Netscape can only deal with

    onclick
    onmousedown
    onmouseup

    ... when you're trying to use radio buttons. Netscape unfortunately doesn't recognise the other attributes available.
    My 2 Cents (or is that 2.2 Cents including GST?)

  3. #3
    SitePoint Member
    Join Date
    Feb 2001
    Location
    Lisboa - Portugal
    Posts
    8
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Hi again


    Here is an example of code:
    <table>
    <tr>
    <td class="formgriscla"><p class="dato">Entrega por correio: </p></td>
    <td class="formgriscla"><input type="radio" name="correio" class="formgriscla" value="sim" onclick="javascript:esconderlayer();">Sim&nbsp;&nbsp;<input type="radio" name="correio" class="formgriscla" value="nao" onclick="javascript:mostrarlayer();">N&atilde;o</td>
    </tr>
    <tr>
    <td class="cabecera" colspan="2"><img src="images/1x1.gif" width=1 height=3 border="0"></td>
    </tr>
    </table>
    <br>

    <div id="envio" style="position:relative; visibility:hidden;">
    <table border="0" cellpadding="3" cellspacing="1" width="500" align="center">
    <tr>
    <td class="cabeceratitulo" colspan="2"><p class="titulotabla">Escolha a Agência: </p></td>
    </tr>
    <tr>
    <td class="formgrisosc"><p class="dato">Distrito: </p></td>
    <td class="formgrisosc"><select name="distrito" size="1" class="formgrisosc"><option value="lisboa">Lisboa</option></select></td>
    </tr>
    <tr>
    <td class="formgriscla"><p class="dato">Ag&ecirc;ncia/p></td>
    <td class="formgriscla">
    <select name="agencia" size="1" class="formgriscla">
    <option value="avliberdade" selected>Av da Liberdade</option>
    <option value="castilho">R. Castilho</option>
    </select>
    </td>
    </tr>
    <tr>
    <td class="cabecera" colspan="2"><img src="images/1x1.gif" width=1 height=3 border="0"></td>
    </tr>
    </table>
    </div>

    and here follows the javascript code:

    function mostrarlayer()
    {
    form=document.forms[0];
    var navegador = (navigator.appName == 'Netscape')?'NS':'IE';
    if(navegador=='NS')
    {
    var layer="envio";
    if(form.correio[1].checked)
    {
    document.layers[layer].visibility='visible';
    }
    }
    if(navegador=='IE')
    {
    var layer = "envio";
    if(form.correio[1].checked)
    {
    document.all[layer].style.visibility='visible';
    }
    }
    }

    function esconderlayer()
    {
    form=document.forms[0];
    var navegador = (navigator.appName == 'Netscape')?'NS':'IE';
    if(navegador=='NS')
    {
    var layer="envio";
    if(form.correio[0].checked)
    {
    document.layers[layer].visibility='hidden';
    }
    }
    if(navegador=='IE')
    {
    var layer = "envio";
    if(form.correio[0].checked)
    {
    document.all[layer].style.visibility='hidden';
    }
    }
    }


    TIA

    Lara


Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •