Div tag wont work in Mozilla


DevX Home    Today's Headlines   Articles Archive   Tip Bank   Forums   

Results 1 to 10 of 10

Thread: Div tag wont work in Mozilla

Hybrid View

  1. #1
    Join Date
    Aug 2006
    Posts
    6

    Div tag wont work in Mozilla

    Hey, I am sure this has been asked and answered (hopefully) but for some reason my code works perfect in IE but not Mozilla.

    function DisplaySection(intSection)
    {
    if (intSection == '1')
    {
    Section1_1.style.visibility = "visible";
    Section1_2.style.visibility = "visible";
    Section1_3.style.visibility = "visible";
    document.getElementById("divSurname").innerHTML = "CONTACT SURNAME *";
    document.getElementById("divFirstname").innerHTML = "CONTACT FIRST NAME *";
    document.forms[0].txtSalesPerson.focus();
    }
    else
    {
    Section1_1.style.visibility = "hidden";
    Section1_2.style.visibility = "hidden";
    Section1_3.style.visibility = "hidden";
    divCompanyError.style.visibility = "hidden";
    document.getElementById("divSurname").innerHTML = "SURNAME *";
    document.getElementById("divFirstname").innerHTML = "FIRST NAME *";
    }


    Here is the onClick event


    <table border="0" cellspacing="0" cellpadding="0">
    <tr>
    <td width="24" class="Goldcapstext"><input Name="rdoCompanyOwned" id="PrivateOwner" type="radio" value="0" onClick="DisplaySection(0)" TabIndex="9"></td>
    <td width="105" class="Goldcapstext">PRIVATE</td> <td width="24" class="Goldcapstext"><input Name="rdoCompanyOwned" id="CommercialOwner" type="radio" value="1" onClick="DisplaySection(1)" TabIndex="10"></td>
    <td width="110" class="Goldcapstext">COMMERCIAL</td>
    <td><img src="assets/spacer.gif" width="10" height="1"><span id="lblErrorCompany" class="Redsmalltext"></span></td>
    </tr>
    </table>


    Here is the div code


    <TD width="200" id="Section1_1" class="Goldcapstext" nowrap>COMPANY NAME *</TD>
    <TD id="Section1_2" align="left" nowrap><input name="txtCompany" type="text" maxlength="255" id="txtCompany" tabindex="11" onClick="hideCompanyDiv()" onChange="hideTitleDiv()" /></TD>
    <TD id="Section1_3" width="1%" nowrap><div id="divCompanyError" style="visibility: visible; display: block;"><span id="lblErrorCompanyText" class="Redsmalltext"></span></div></TD>

    Can someone help please?!?!

  2. #2
    Join Date
    Aug 2003
    Posts
    313
    Can you tell us what exactly it is doing in Mozilla, and are you using Mozilla or just a geko variant such as Firefox. Also, does it work in Opera?
    ~evlich

  3. #3
    Join Date
    Aug 2006
    Posts
    6
    Sorry about that...I should have mentioned what it is/isnt doing.

    In IE it hides the appropriate fields when a radio button is pressed etc but it doesnt hide/show the fields in Firefox (This is the mozilla browser I am using). As far as I know it doesnt work in Opera but will download and check.

    I didnt write this code however I have been given the job to try to debug hence the post here.

  4. #4
    Join Date
    Aug 2006
    Posts
    6
    I stand corrected...it does work in Opera

  5. #5
    Join Date
    Aug 2003
    Posts
    313
    Can you post a link or something that we can try it in?
    ~evlich

  6. #6
    Join Date
    Aug 2006
    Posts
    6

    Div Tag not displaying in Mozilla

    Attached is a file, just rename to .html. I cannot post a link as this is a secure site for Honda.

    This works in IE by clicking on the private and commercial radio button at the bottom left column.
    Attached Files Attached Files

  7. #7
    Join Date
    Aug 2003
    Posts
    313
    When I run it in IE, I don't see any changes that occur when I click the private or commercial buttons at the bottom. I am running IE7, but hopefully that isn't a problem. I think that you also need to upload the layer.js file, which seems to be sourced in the header.

    Thanks.
    ~evlich

  8. #8
    Join Date
    Aug 2006
    Posts
    6
    It should work as I have tested this in (working) IE 7, IE 6, Opera and (not working) Firefox and Netscape. The only change is there are 3 fields on the top right hand column that are hidden and displayed depending on what is clicked (private or commercial)

  9. #9
    Join Date
    Aug 2003
    Posts
    313
    When I run it in Firefox I get a missing function definition getObj, which I'm assuming is defined in the layer.js file. You didn't post that, so I can't get anything to work. When you run it in Firefox, you should see if you get errors in the Javascript console, it is usually very helpful for development.
    ~evlich

  10. #10
    Join Date
    Aug 2006
    Posts
    6

    Still no div

    Still having the same issue with my div tag, cant post the layer file as I dont have access to it sorry.

    Still looking for a solution.

Similar Threads

  1. Scrollbars in IE display in the DIV tag
    By Billkamm in forum Web
    Replies: 0
    Last Post: 04-20-2006, 01:58 PM
  2. DataList not using <BODY> tag settings
    By jrothlander in forum ASP.NET
    Replies: 6
    Last Post: 04-27-2005, 04:43 PM
  3. div tag
    By Keith in forum Web
    Replies: 0
    Last Post: 02-11-2003, 02:47 PM

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


   Development Centers

   -- Android Development Center
   -- Cloud Development Project Center
   -- HTML5 Development Center
   -- Windows Mobile Development Center