473,405 Members | 2,262 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,405 software developers and data experts.

java script code not working with firefox

this is my code and i call this code from code behinde file on page load
like this
useragree.Attributes.Add("onclick", "CheckSelection();")

this is working fine with IE but not working with fire fox.

in firefox i got error :
Error: CheckSelection is not defined




Expand|Select|Wrap|Line Numbers
  1. <script language="javascript" type="text/jscript">
  2.   function CheckSelection()
  3.    {
  4.         var chk1 = document.getElementById("useragree");
  5.         var button =document.getElementById("signup");
  6.         if (chk1.checked == true)
  7.         { 
  8.          button.disabled=false;
  9.         }
  10.         else
  11.         {
  12.         button.disabled=true;
  13.         }
  14.    }
  15.  
</script>
Jul 5 '07 #1
5 6570
acoder
16,027 Expert Mod 8TB
The script tag's type attribute should be "text/javascript", not "text/jscript". JScript only works in IE.
Jul 5 '07 #2
The script tag's type attribute should be "text/javascript", not "text/jscript". JScript only works in IE.

Thanks
it's working.
again thank u very much.:)
Jul 6 '07 #3
this code also not working with fire fox can u plz help me.


Expand|Select|Wrap|Line Numbers
  1. <script language="javascript" type="text/javascript">
  2.  
  3. function CheckSelection()
  4.     {
  5.  
  6.         var txt =document.getElementById("txtnewemail")
  7.         var rd =document.getElementById("rdYes")
  8.        if (rd.checked==true)
  9.     {
  10.         document.getElementById("divtxt").style.visibility = "visible";
  11.         document.getElementById("divtxt").style.display = "block";
  12.     } 
  13.     else
  14.     {
  15.         document.getElementById("divtxt").style.visibility = "hidden";
  16.         document.getElementById("divtxt").style.display = "none";
  17.     }
  18.     }
  19.  
  20.  
i call function like this

[HTML]<tr>
<td class="contentText" colspan="2">
<b>Do you want to earn commission selling your home?</b>
<input id="rdyes" onclick="CheckSelection()" type="radio" value="1" name="rd" runat="server" />Yes
<input id="rdno" onclick="CheckSelection()" type="radio" value="0" name="rd" runat="server" />No
</td>
</tr>[/HTML]
Jul 6 '07 #4
gits
5,390 Expert Mod 4TB
hi ...

at a first look i see that you have a typo with id="rdyes" ... you try to getElementById('rdYes') ... but the ids are case sensitive ... getElementById will not find your element and var rd will be undefined ...

kind regards
Jul 6 '07 #5
hi ...

at a first look i see that you have a typo with id="rdyes" ... you try to getElementById('rdYes') ... but the ids are case sensitive ... getElementById will not find your element and var rd will be undefined ...

kind regards

Thanks it's working ..
Jul 6 '07 #6

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

Similar topics

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: JOJO123 | last post by:
I got here in search of an answer to this Javascrpt question. I upgraded jave on XP Ie 7, acrobat 5.1 and suddenly can't open any pdf files on web sites using IE. I see u guys all say, this is a...
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...
4
by: Quill_Patricia | last post by:
I have a Python script which is used to load data into a database. Up to now this script has been run by customers from the Windows command prompt using "python edg_loader.pyc". Any error messages...
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. ...
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
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
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.