473,383 Members | 1,868 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,383 software developers and data experts.

Script working in IE but not in Firefox

Hello,
My java script function is working well in IE but not in Firefox

My javascript is

function visible()
{
if(document.getElementById('Jurisdiction').getAttr ibute("value")=="AL"&&document.getElementById('rdo Reservation').getAttribute("checked")==true)
{

document.getElementById("ALRes").style.visibility ='visible';
}
if(document.getElementById('Jurisdiction').getAttr ibute("value")=="AL"&&document.getElementById('rdo Registration').getAttribute("checked")==true)
{
document.getElementById('ALReg').style.display='bl ock';
}

The above function is to display a particular div this is working in IE but not in firefox

My div is
<div id="AKRes" style="display:none">
<div class="contentBoxHeader">
<h3>Alaska Registration Information</h3>
</div>
---------
---------
---------
</div>

I am calling this function in my dropdown like this
<select id="Jurisdiction" name="Jurisdiction" onchange="visible();">

Any one help me please
Jun 11 '07 #1
4 2209
gits
5,390 Expert Mod 4TB
hi ...

try to play with the following:

[HTML]
<script>
function visible() {
var menulist_value = document.getElementById('Jurisdiction').value;
var checkbox_value = document.getElementById('rdoReservation').checked;

var al_display = menulist_value == 'AL' && checkbox_value == 'true';

document.getElementById("ALRes").style.visibility = al_display ? 'visible' : 'hidden';
}
</script>

<form>

<select id="Jurisdiction" name="Jurisdiction" onchange="visible();">
<option value="AL">AL</option>
<option value="BL">BL</option>
</select>

<input type="checkbox" id="rdoReservation"/>

</form>


<div id="ALRes" style="visibility: hidden">
<div class="contentBoxHeader">
<h3>Alaska Registration Information</h3>
</div>[/HTML]

kind regards ...
Jun 11 '07 #2
hi ...

try to play with the following:

[HTML]
<script>
function visible() {
var menulist_value = document.getElementById('Jurisdiction').value;
var checkbox_value = document.getElementById('rdoReservation').checked;

var al_display = menulist_value == 'AL' && checkbox_value == 'true';

document.getElementById("ALRes").style.visibility = al_display ? 'visible' : 'hidden';
}
</script>

<form>

<select id="Jurisdiction" name="Jurisdiction" onchange="visible();">
<option value="AL">AL</option>
<option value="BL">BL</option>
</select>

<input type="checkbox" id="rdoReservation"/>

</form>


<div id="ALRes" style="visibility: hidden">
<div class="contentBoxHeader">
<h3>Alaska Registration Information</h3>
</div>[/HTML]

kind regards ...

Thanks for ur reply, but my problem is i have some 64 options in dropdown and 128 divs (2div for one option) i am also using radio button
so please help
Jun 11 '07 #3
gits
5,390 Expert Mod 4TB
... in that case you should try not to hide/show divs ... it would be much better to create your elements depending to your selection ... and append them to a single container ... you set the attributes that you need dependent to your selection ... and this would be much better to code and to maintain ...

kind regards ...
Jun 11 '07 #4
gits
5,390 Expert Mod 4TB
... i thought it over ;) ... it seems that you have the value of your select-box suffixed with 'Res' and 'Reg' for your divs? ... is that a general rule in your html-code, so that we may rely on that? ... please try to make more clear what is the problem. are there differences between the divs or do they all have the same elements? ...
Jun 11 '07 #5

Sign in to post your reply or Sign up for a free account.

Similar topics

3
by: pantagruel | last post by:
The following does not work in firefox: <script defer="defer"> var x=document.getElementsByName("repositoryNamespace") alert(x.length + " elements!")
5
by: Mark Szlazak | last post by:
Apparently there is a textarea onscroll event bubbling bug in Firefox and Mozilla: https://bugzilla.mozilla.org/show_bug.cgi?id=229089 I'm trying to check for this bug with the following...
23
by: Loony | last post by:
I have got a code like this in HTML section in ASP file which includes javascript file! The script works under MS IE but doesn't with Firefox! Can anybody tell me what is wrong? <HTML>...
9
by: whitgurley | last post by:
I've searched the web as well as I can for a solution to this problem but have found nothing and just don't know enough about JavaScript to figure out what's going. What I'm trying to do is convert...
6
by: Toby Inkster | last post by:
Does anyone have any idea why this effect using script.aculo.us is working in Opera, but not Firefox? http://examples.tobyinkster.co.uk/Balloons2/Balloon%20tooltip.html (I've not had the...
1
by: bbammes | last post by:
I'm writing a click tracking program which calls a remote PHP script when a user clicks a link. My javascript is: <script type="text/javascript"> //<! ); ?>&clientaddress=<?php echo urlencode(...
2
by: willyWEB66 | last post by:
Hi everyone, I have this code in javascript where the XML file is loaded and displayed to an html using XSLT. It works fine in IE but not in Firefox. My problem is in the looping to the...
7
by: labmonkey111 | last post by:
I'm having trouble with the following code: <SCRIPT> <!-- if (navigator.appName == 'Microsoft Internet Explorer') { document.write("<link rel=\"stylesheet\" type=\"text/css\"...
7
by: mike57 | last post by:
The minimal AJAX script below works in Firefox, but not in IE, Opera, or Chrome. I could use some suggestions or referrals to resources that will help me get the script working in other browsers. ...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...
0
by: ryjfgjl | last post by:
In our work, we often need to import Excel data into databases (such as MySQL, SQL Server, Oracle) for data analysis and processing. Usually, we use database tools like Navicat or the Excel import...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
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...

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.