473,406 Members | 2,259 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,406 software developers and data experts.

Netscape and style="visibility:show"

I have a form and in the form, I have a drop down box. Based on what
the user selects, i want to display different input boxes. Here is my
drop down box:

<td>
<select name="reptype" onchange="checkVersion4()">
<option value=""></option>
<option value="A">A:</option>
<option value="B">B:</option>
<option value="C">C:</option>
</select> </td>
So, as soon as there is a change i call my "checkVersion4()" and in
there i want to hide a this input box that I have in my form:
<div id="div1" style="visibility:show"> <input type="text"
name="repchapter" />
</div>
and my method checkVersion4() is:
eval(document.div1.visibility = 'hidden');

I can't get this to work on Netscape I got it working on IE. Does
anyone have an idea why? Or know of a good example for Netscape or Mozilla?

Thanks

Jul 20 '05 #1
1 3277
DU
Ahmad Noori wrote:
I have a form and in the form, I have a drop down box. Based on what
the user selects, i want to display different input boxes. Here is my
drop down box:

<td>
<select name="reptype" onchange="checkVersion4()">
<option value=""></option>
<option value="A">A:</option>
<option value="B">B:</option>
<option value="C">C:</option>
</select> </td>
So, as soon as there is a change i call my "checkVersion4()" and in
there i want to hide a this input box that I have in my form:
<div id="div1" style="visibility:show">
It's visibility:visible or visibility:hidden. You're using the old (and
invalid) NS 4 property value (show).
http://www.w3.org/TR/CSS2/visufx.htm...def-visibility

<input type="text" name="repchapter" />
</div>
and my method checkVersion4() is:
eval(document.div1.visibility = 'hidden');
I recommend to never use eval; 99.9% of the times, eval() is not best.
When you try to access a document node, one of the W3C DOM 2 compliant
way is to use the getElementById method. E.g.:

document.getElementById("div1").style.visibility = 'hidden';

which will work in all W3C compliant browsers (MSIE 5+ on all platforms,
Opera 6+, Mozilla 0.9+, NS 6+, Konqueror 3+, Safari 1.x, etc...).

I can't get this to work on Netscape I got it working on IE. Does
anyone have an idea why? Or know of a good example for Netscape or
Mozilla?

Thanks


Using Web Standards in Your Web Pages
http://www.mozilla.org/docs/web-deve...upgrade_2.html

Updating DHTML Web Pages for next generation browsers
http://devedge.netscape.com/viewsour...tml-web-pages/

You should declare a doctype and then validate your markup and CSS source.

http://www.w3.org/QA/2002/04/valid-dtd-list.html

http://validator.w3.org/

W3C Quality Assurance: Quality tips for webmasters
http://www.w3.org/QA/Tips/

Web developer documentation for Mozilla
http://www.mozilla.org/docs/web-developer/

DU
Jul 20 '05 #2

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

13
by: Dan R Brown | last post by:
I have a large form that is generated dynamically in a jsp using xml / xslt. So, to break up this form into several "tabbed" sections, I break up the form using <div> tags. Each <div...
1
by: Perttu Pulkkinen | last post by:
I would like to have a javasript/jscript function template/"framwork" instead of checking browsers by name. The shortness of script in my opinion is not the goal, but clearness and ease iof...
7
by: Larry R Harrison Jr | last post by:
I am looking for javascript and a basic tutorial on how to make mouse-over drop-down menus--the type that when you "hover" over a subject links relevant to that subject "emerge" which you can then...
12
by: Lee David | last post by:
How do you track down this to where the error actually is? TIA, Lee
2
by: | last post by:
I have a page where I have 3 combo boxes listed in a column. sort of like: combo1 combo2 combo3 Based on which one is clicked, the others are supposed to hide (i.e. combobox.visible =...
4
by: Daniel | last post by:
Hi, I have problem to get the control id and set its visible to true/false(mean show/hide). here is my code: <%@ Control Language="vb" AutoEventWireup="false" Codebehind="ucNavbar.ascx.vb"...
1
by: msg2ajay | last post by:
hi, i am working on <div> i have to hide some part of the table. I am not able to hide that table part can anybady tell me where is the error. <html> <head> <script...
7
by: r_ahimsa_m | last post by:
Hello, I am learning JavaScript. I have a table on HTML page:                 <table id="announcement_fields" border="0">                 <tbody>                 <tr>...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.