.NET Tutorials, Forums, Interview Questions And Answers
Welcome :Guest
Sign In
Win Surprise Gifts!!!

Top 5 Contributors of the Month
Gaurav Pal
Post New Web Links

javascript is not working in firefox

Posted By:      Posted Date: September 28, 2010    Points: 0   Category :ASP.Net

Hi friends,


I have some javascript function on the master page and im calling the same function from the other forms which is using this masterpage.

The code is working fine in IE but not in firefox, google chrome, opera.

my javascript on master page is like this

< script type="text/javascript">

 function ClientPrint(str)







View Complete Post

More Related Resource Links

hide gridview column using javascript. working in ie and firefox but In firefox, gridview data is sh


function EnableDisableGridViewColumn() {
               var AdvanceSearch = document.getElementById('<%= chkboxlist1.ClientID %>');
               var chkList = AdvanceSearch.getElementsByTagName("input");
               var dgTest = document.getElementById("gridview1")
               if (dgTest != null)
                   for (var i = 1; i < dgTest.rows.length; i++) {

                       if (chkList[0].checked == true && chkList[1].checked == true) {
                           dgTest.rows[0].cells[0].style.display = "block";

javascript not working in Firefox/Safari


I hope this is the correct place for this post as it's relevant to both ASP.NET and Javascript.

I am creating a nested ListView. In the ListView1 the first column contains an asp:Literal control named LiteralTreeIcon.

In the event OnItemDataBound of ListView1 I am doing the following:

Literal treeIcon = e.Item.FindControl("literalTreeIcon") as Literal;

if (treeIcon != null)
treeIcon.Text = invoices.Count() == 0
? "<img src=\"../Images/treedot.gif\" alt=\"\" height=\"16\" width=\"16\" />"
: String.Format(
"<img src=\"../Images/buttonplus.png\" alt=\"\" height=\"16\" width=\"16\" onclick=\"javascript:toggleGroup(this,'invoices{0}');\" />", header.ID);

This is working correctly, as in the icons are changing depending if there is data in the second ListView or not.

I then have a Javascript function in my ASP.NET page:

function toggleGroup(img, childName) {
var src = img.src;
var parentObject = document.getElementById(childName);

if (parentObject == null) {

javascript function is not working with Firefox



    Javascript function is not working with Firefox. Its working fine with Chrome + IE.


function rdblstSec5SystemOnly_SelectedIndexChanged()
    var rdblstSec5SystemOnly = document.getElementsByName('<%= rdblstSec5SystemOnly.ClientID %>');
    var SelValue;
    //loop through the items in radiobuttonlist
        for (var j = 0; j < rdblstSec5SystemOnly.length; j++)
            if (rdblstSec5SystemOnly[j].checked) 
                SelValue = rdblstSec5SystemOnly[j].value.toLowerCase();
                if(SelValue == "yes")
                     trSec5ProductOrderForm.style.visibility = "hidden";
                else if(SelValue == "no")
                     trSec5ProductOrderForm.style.visibility = "visible";

<asp:RadioButtonList ID="rdblstSec5SystemOnly" runat="server" RepeatDirection="Horizontal"
                                                            <asp:ListItem Text="Yes" Value="Yes" />

Gridview check all not working in Mozila Firefox


hi all,

i has an gridview first column header is Checkbox, when i click on that all the detail column checkboxes were selected if i use IE but the same not working in Mozila Firefox

below is my code

function checkAll()
                  var totalChkBoxes = parseInt('<%= gv5.Rows.Count %>');
                  var gvControl = document.getElementById('<%= gv5.ClientID %>');
                  var gvChkBoxControl = "cbCheckProd";
                  var mainChkBox = document.getElementById("chkBoxAll");
                  var inputTypes = gvControl.getElementsByTagName("input");
                  for (var i = 0; i < inputTypes.length; i++)

javascript function not working with datalist


I have a datalist and there is a check box within this datalist in a .ascx page.  But I have to have an image out side the datalist.  So here is the code and its not owrking.  When I click on the image, I dont see any alert box. 


<script Language="JavaScript" type="text/javascript">


function validate_checkbox()



// set var checkboxSelect to zero

var checkboxSelect = 0;

var sProducts = "";


var multiCheck = window.document.forms["frmCompare"].CompareCheck.length;


if (multiCheck != null)


    // Loop from zero to the one minus the number of checkbox button selections

    for (counter = 0; counter < window.document.forms["frmCompare"].CompareCheck.length; counter++)


        if (window.document.forms["frmCompare"].CompareCheck[counter].checked)


            var seperator = (checkboxSelect > 0)?",":"";

            sProducts += sep

Javascript fails in chrome and firefox, works fine in IE



I am customizing Newform.aspx i.e. hiding some fields, making other readonly etc. It works fine in IE but fails miserably in chrome and firefox i.e. readonly are no more readonly, hidden are no more hidden. Here is my code:

<script language="javascript" type="text/javascript">
    function autoFillFields()
       var ctrl = findacontrol("Reference Customer");
    var param = getURLParam('RefFromCust');   
    var properParam = replaceCharacters(param);
    ctrl.value = properParam;
    var ctrl = findacontrol("RefReqOpptyId");
    var param = getURLParam('OpptyId');   
    var properParam = replaceCharacters(param);
    ctrl.value = properParam;

    param = getURLParam('RefFromAE');
    properParam = replaceCharacters(param);
    setPeoplePicker("People Picker", properParam);
    hideFldCtrl("Approval Sta

Code write file asp.net 2.0 is working in firefox but IE not working.

If Not IsDBNull(ext) Then                                        ext = LCase(ext)                                    End If                                    Select Case ext                                        'Case ".htm", ".html"                                        '    type = "text/HTML"                   

CSS font is working in FireFox but not in Internet Explorer 8.0

Hi All, I tried a lot but I could not figure out why the IE is not taking font size and name in to effect from CSS. In firefox my website could be seen very nice but in IE it is little bit unshiny and font size is bigger For the difference which I am talking about could be seen  if your PC have both firefox and IE installed. Please go to http://www.nymidtowndentistry.com open it in FF and IE and you could see the font and alignment related change. All these settings are in body element of CSS. Do you any idea regarding this? Any help would be appreciated. Thanks for your time. -Hitesh  

javascript not working in iframe on remote site

<html> <body style="background-color: White;"> <form name="ctl01" method="post" action="adv_links_addbycustomer.aspx" id="ctl01"> <div> <input type="hidden" name="__VIEWSTATE" id="__VIEWSTATE" value="/</div> <div> <input type="hidden" name="__EVENTVALIDATION" id="__EVENTVALIDATION" value="/dfdafa" /> </div> <div style="background-color:White;"> <span id="lblMsg" class="ErrorText" style="font-weight:bold;"></span> <center> <span id="Label1" style="font-size:X-Small;font-weight:bold;">Valid Urls</span> <select name="DropDownList1" id="DropDownList1" style="background-color:#EFEFEF;border-color:#898989;border-width:1px;border-style:Solid;font-size:8pt;padding:0px;"> <option value="0"> - Select - </option> <option value="http://www.fha-home-loans.us/index.htm">http://www.fha-home-loans.us/index.htm</option> <option value="http://www.fha-home-loans.us/jumbomortgage/apply.htm">http://www.fha-home-loans.us/jumbomortgage/apply.htm</op

Background image of Anchor not working with Safari/Firefox

Hi, I have following Css where i have used back-ground image. Then i am generating Anchor and assigning css class which has image. It works fine with IE but does not work with Safari,Firefox and Chrome. Can anyone help me on how to fix it. I have given details below. Thanks, Chandan Css .HOME { BACKGROUND-IMAGE: url(../images/home.jpg); WIDTH: 56px; BACKGROUND-REPEAT: no-repeat; HEIGHT: 20px } .HOME A { WIDTH: 56px; HEIGHT: 20px } .HOME A:hover { BACKGROUND-IMAGE: url(../images/home1.jpg); WIDTH: 56px; HEIGHT: 20px } Html Code<td class="home"> <A href="#" class="home" onclick="showpage('abc.html')"/></td>

Javascript Error in Internet Explorer but works fine in Firefox

Hi All,i was working on one of the project as it is working fine in Firefox but it is giving the javascript exception in internet explorer.Errror:  Error says  "s" is undefined in the s.currencyCode="USD" line but "s" is defined in the external javascript file  s_code.jsCan anyone suggest the solution for this issue:Please find my code where the error is displayed <script type="text/javascript" language="JavaScript" >var s_account="mnsdev"</script><script type="text/javascript" language="JavaScript" src="http://media.world.com/ads/usen/rpt/Omniture/s_code.js"></script><script type="text/javascript" language="JavaScript" >s.currencyCode="USD"s.charSet="ISO-8859-1"s.SEMct = s.getQueryParam('s_kwcid');s.SEMct = s.getValOnce(s.SEMct,'SEM_ct',0);s.clickPast(s.SEMct,'event9','event10');s.SEMvar=s.getQueryParam('s_kwcid');s.SEMdate=new Date;s.SEMdate.setTime(s.SEMdate.getTime()+60*86400000)if(s.SEMvar){s.c_w('SEM_ck','1',s.SEMdate)}s.SEMchk=s.c_r('SEM_ck');if(s.SEMchk&&s.events)s.SEMok='ok';if(s.SEMvar||s.SEMok) s.t()

Changing Firefox values in about:config via Javascript

Hi WebGurus, I am currently facing a problem with Mozilla firefox JavaScript window.close() not working / does not work in firefox Is there any way of changing the values in about:config (specifically dom.allow_scripts_to_close_windows ) using Javascript, or via any other method when a page loads? Basically, I need a way of telling Firefox to close the window. If there is a better way of doing this please give me some guidelines regarding it. Thanks In Advance,Santosh

Javascript funtion working in FF but not in IE

Hi I have a button control on click of which a javascript funtion is called but this function is calling in FF but not in IE7. Can you please suggest what are the possible ways to overcome it. <cc1:MessagizedButton ID="btSave" runat="server" OnClickClientHandler="_s.widgets.editSavedSearchWidget.saveData();return false;" IsLinkButton="true" IsRegisteredOnClient="true" />  and the funtion is: Note: Even the alert('b') is not calling but calling in FFsaveData: function() { alert('b'); var var_value = $("input[name='savedSearchEditOpt']:checked").val(); var data = ""; //alert(var_value); //show spinner $('.wdgEditSpinner').show(); if (var_value == null) return; if (var_value == 1) { data = true; } else { data = false; } _s.services.imonsterWidgets.updateUserWidgetAttribute(_s.imonster.userWidget.allWidgets.savedsearches, _s.imonster.userWidget.widgetAttrids.edit, data, _s.widgets.editSavedSearchWidget.onSaveSuccess, _s.widgets.editSavedSearchWidget.getError); },

javascript to hide ModalPopupExtender not working

Hello, I've seen some other posts about this but never found a resolution to it. I have a gridview control with another gridview inside each row. I'm using a masterpage and I have a TabContainer to boot and of course updatepanels. I'm showing my gridview child via a modal popup extender. It shows great and other JQuery operations are working as expected. I have a pageLoad javascript that does the following: function pageLoad(sender, args) {      $addHandler(document, "keydown", OnKeyPress);   } And, function OnKeyPress(args) {      if (args.keyCode == Sys.UI.Key.esc) {         var mp = $find('<%=mpe1.clientid%>');         mp.hide();      }   } The var mp seems to be returning an object as '<%=mpe1.clientid%>' returns the clientid, and the mp.hide() line executes without error. It doesn't hide the popup however. What can be the problem?S

ondeactivate="" onactivate="" events not working in firefox 3.6

Hi    I am working with the following code this code working fine with IE7 But not working with  fireforx 3.6 Functionality is when I click on Dive (textarea) tag its shows AlertMe button and Share button and textarea height will change and when I click outside of my Dive tag textarea size will set to old size and buttons will hide. In IE7 its works fine but in Firefox 3.6 ondeactivate="SetOldSize();" onactivate="SetNewSize();" this functions are not working <body>    <h1>       Textarea Demo</h1>    <form id="form1" runat="server">        <div>            <table border="0" height="100px" width="500px">                <tr>                    <td style="vertical-align: top">                        <div style="width: 520px; border: 0px" onclick="SetNewSize();" ondeactivate="

javascript is not working in IE7 on Windows vista machine..

Hi all,My web application contains javascript and jquery ajax functions, updatepanel controls. It is working fine in firefox, chorme, and safari. But, when I try run this in IE 7 on Windows vista machine, it does not work(i mean the jquery ajax function, javascript, and updatepanel controls not working).when I run this it displays the alert message that says, "to enable script, choose 'Options' from IE tools menu and navigate to 'Advanced Tab' and go to 'Browsing' Category and clear the 'Disable Script Blocking (IE) and Disable script Blocking (other)'".I did as the alert message says. Even, I have changed javascript, updatepanel control is not working in IE 7 on windows vista machine.I have checked 'Security' Tab also..Any solution for that?Thanksr.eswaran.

Validation is not working in Custom List Form using JavaScript ddwrt:GenFireServerEvent()

Hii am creating custom New form for a list using sharepoint designer. i have added the below button for sumbit<input name="Submit1" type="submit" value="Submit" onclick="javascript: {ddwrt:GenFireServerEvent('__commit;__redirect={http://myserver/Lists/VTest/AllItems.aspx}')}" />                <xsl:text xmlns:ddwrt="http://schemas.microsoft.com/WebParts/v2/DataView/runtime" ddwrt:nbsp-preserve="yes" disable-output-escaping="yes">&amp;nbsp;                                    </xsl:text><input name="Submit2" type="submit" value="Cancel" onclick="javascript: {ddwrt:GenFireServerEvent('__redirect={http://myserver/Lists/VTest/AllItems.aspx}')}" />the problem is the validation is not working properly. it submits the page without entering values for the required fields.particularly the validation is not working for DateFields.let me know what is the problem here. is it a Bug?muthu
ASP.NetWindows Application  .NET Framework  C#  VB.Net  ADO.Net  
Sql Server  SharePoint  Silverlight  Others  All   

Hall of Fame    Twitter   Terms of Service    Privacy Policy    Contact Us    Archives   Tell A Friend