DevX Home    Today's Headlines   Articles Archive   Tip Bank   Forums   

+ Reply to Thread
Results 1 to 2 of 2
  1. #1
    keith Guest

    Div tag problems


    In my div tag I had to give the style a position (style="position: relative;
    visibility: hidden")
    before it would work in Netscape.

    Now the div tag show and hides but when it shows it only shows the 1st <td>
    tag "reason Canceled" it does not show the select box.

    Any one have any ideas or suggestions?
    Thanks

    <HTML>
    <HEAD>

    <TITLE>Layers with div</TITLE>

    <script language="JavaScript">
    <!--
    var NN4 = document.layers? true : false;
    var IE4 = document.all? true : false;

    //var isDom = document.getElementById? true : false;

    function init(){
    if(NN4) layer = document.CancelReason
    if(IE4) layer = CancelReason.style
    }

    function display() {

    if (IE4) {
    document.all['CancelReason'].style.visibility = "visible";
    }else if(NN4) {
    document.layers['CancelReason'].visibility = "show";
    }
    }

    function hide() {
    if (IE4) {
    document.all['CancelReason'].style.visibility = "hidden";
    }else if(NN4) {
    document.layers['CancelReason'].visibility = "hide";
    }
    }
    // -->
    </script>
    </HEAD>
    <BODY onload="init()">
    <form name="frmtest">
    <div id="CancelReason" name="CancelReason" style="position: relative; visibility:
    hidden">
    <table width="90%" border="2" cellspacing="1">
    <tr>
    <td class="required" width="20%">Reason Canceled:</td>
    <td>
    <select name="whycanceled">
    <option value="0">Because</option>
    </select>
    </td>
    </tr>
    </table>
    </div>

    <input type="radio" value="0" name="rdoResults" onclick="javascipt:hide('layer')">hide
    <input type="radio" value="1" name="rdoResults" onclick="javascipt:display('layer')">display

    </form>

    </BODY>
    </HTML>




  2. #2
    dman Guest

    Re: Div tag problems


    For Netscape displaying form elements you must open with form tag and
    close it by sequence, this will Netscape display form elements.
    And for IE is not to do this. It display form elements even no form tag.

    dman

    "keith" <keith.stephens@secure-point.net> wrote:
    >
    >In my div tag I had to give the style a position (style="position: relative;
    >visibility: hidden")
    >before it would work in Netscape.
    >
    >Now the div tag show and hides but when it shows it only shows the 1st <td>
    >tag "reason Canceled" it does not show the select box.
    >
    >Any one have any ideas or suggestions?
    >Thanks
    >
    ><HTML>
    ><HEAD>
    >
    ><TITLE>Layers with div</TITLE>
    >
    ><script language="JavaScript">
    ><!--
    >var NN4 = document.layers? true : false;
    >var IE4 = document.all? true : false;
    >
    >//var isDom = document.getElementById? true : false;
    >
    >function init(){
    > if(NN4) layer = document.CancelReason
    > if(IE4) layer = CancelReason.style
    >}
    >
    >function display() {
    >
    >if (IE4) {
    > document.all['CancelReason'].style.visibility = "visible";
    >}else if(NN4) {
    > document.layers['CancelReason'].visibility = "show";
    >}
    >}
    >
    >function hide() {
    >if (IE4) {
    > document.all['CancelReason'].style.visibility = "hidden";
    >}else if(NN4) {
    > document.layers['CancelReason'].visibility = "hide";
    >}
    >}
    >// -->
    ></script>
    ></HEAD>
    ><BODY onload="init()">
    ><form name="frmtest">
    ><div id="CancelReason" name="CancelReason" style="position: relative; visibility:
    >hidden">
    ><table width="90%" border="2" cellspacing="1">
    > <tr>
    > <td class="required" width="20%">Reason Canceled:</td>
    > <td>
    > <select name="whycanceled">
    > <option value="0">Because</option>
    > </select>
    > </td>
    > </tr>
    ></table>
    ></div>
    >
    ><input type="radio" value="0" name="rdoResults" onclick="javascipt:hide('layer')">hide
    ><input type="radio" value="1" name="rdoResults" onclick="javascipt:display('layer')">display
    >
    ></form>
    >
    ></BODY>
    ></HTML>
    >
    >
    >



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
HTML5 Development Center
 
 
FAQ
Latest Articles
Java
.NET
XML
Database
Enterprise
Questions? Contact us.
C++
Web Development
Wireless
Latest Tips
Open Source


Top DevX Stories

Easy Web Services with SQL Server 2005 HTTP Endpoints
JavaOne 2005: Java Platform Roadmap Focuses on Ease of Development, Sun Focuses on the "Free" in F.O.S.S.
Wed Yourself to UML with the Power of Associations
Microsoft to Add AJAX Capabilities to ASP.NET
IBM's Cloudscape Versus MySQL


Sponsored Links