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


Top 5 Contributors of the Month
david stephan
Santhakumar Munuswamy
Fauzul Azmi
Asad Ali
Post New Web Links

Urgent (Firefox : javascript tp get firstChild.value)

Posted By:      Posted Date: October 11, 2010    Points: 0   Category :ASP.Net
 

 This works fine in IE but it does not work in firefox

  function displayTimeDiff(s){
                var tr = s.parentNode.parentNode;   
                var tds = tr.childNodes;   
               
                var f = tds[4].firstChild.value;  //from   //this is undefine din firefox
             
                    
                var t = tds[5].firstChild.value;  //to   //this is undefine din firefox

}


this part of the datagrid

 <asp:TemplateColumn>
                        <HeaderTemplate>
                            <asp:Label runat="Server" ID="lbl_from" Text="From"></asp:Label>
                        </HeaderTemplate>
                        <ItemTemplate>
                                                       <asp:TextBox runat="Server" ID="tb_time_from1" Columns="6" MaxLength="10" Text='<%#Container.DataItem("time_from")%>'
                                onChange='displayTimeDiff(this);'></asp:TextBox>
                             </ItemTemplate>
                        <HeaderStyle BackColor="WhiteSmoke" />
                    </asp:TemplateColumn>

      &nbs


View Complete Post


More Related Resource Links

Javascript fails in chrome and firefox, works fine in IE

  

Hi,

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">
    _spBodyOnLoadFunctionNames.push("autoFillFields");
    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

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

urgent help in javascript

  
Hiiii Coders, I m using javascript functions for image slideshows such that each and every slide changes after 3 sec. Even user can click on button to start and stop playing slides. Now what i want that whenever an image is displayed then on right side inside my div it also displays my three products in similar fashion. Means on the top it displays first product, after displaying it, it should also display sec product below it after 1sec and then after it display third product on the bottom after 1sec. All the things should be in flash manner. plz provide some code snippets as soon as poss thanx and regards.     

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 is not working in firefox

  

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)

{

alert('before');

PrintControl.RawPrint(str);

alert('after');

 }

  </

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:

		//<![CDATA[
function toggleGroup(img, childName) {
var src = img.src;
var parentObject = document.getElementById(childName);

if (parentObject == null) {

Access gridview row using javascript (row/cell index works in IE not in Firefox )

  

Hello All,

I have a gridview with checkboxes and textboxes. When i click on a checkbox i want the associated textbox to be enabled/disabled. I wrote the for following javascript that.

 for (var i = 1; i <= grid.rows.length - 1; i++) {
                   alert(grid.rows[i].cells[0].childNodes[2].checked);
                   if (grid.rows[i].cells[0].childNodes[2].checked) {
                       grid.rows[i].cells[1].childNodes[0].disabled = false;
                   }
                   else {
                      
                       grid.rows[i].cells[1].childNodes[0].disabled = true;
      &nbs

JavaScript problem for mozilla firefox

  

Hi all,

i have developed one site. My requirement is that in the signup form i have denied entering of alphabets using javascript

script is as follows

<code>

if ((e.keyCode>=65 && e.keyCode<=90 )||(e.keyCode>=97 && e.keyCode<=122 ) ||  e.keyCode==32 || e.keyCode==46)
           {}
     else     
           {
              alert('Please Enter Only Alphabet');
              e.keyCode=0;
           }

</code>


This script Works very fine on IE 6,7,8 but when i switched to mozilla firefox it wont works

plz help me


Javascript button click event oddity in FireFox

  

Hi Everyone -- This code works fine when outside of an UpdatePanel, but when inside, the server side event never gets called.  It works fine in IE (both inside and outside of an UpdatePanel).

Any Ideas?  Code to repro below:

<%@ Page Language="C#" AutoEventWireup="true" CodeFile="Default.aspx.cs" Inherits="_Default" %>

<html xmlns="http://www.w3.org/1999/xhtml" >

<head runat="server"></head>

<body

pageLoad() in javascript is not called in Firefox and crome

  

I have written a javascript function as

function pageLoad{

//content of the function

}

This javascript pageLoad function is called in IE9, but the same is not working in Firefox4 and Crome10


javascript function is not working with Firefox

  

hi,

    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();
                //alert(SelValue);
                if(SelValue == "yes")
                { 
                     trSec5ProductOrderForm.style.visibility = "hidden";
                }
                else if(SelValue == "no")
                {
                     trSec5ProductOrderForm.style.visibility = "visible";
                }
                break;
            }
        }
}

<asp:RadioButtonList ID="rdblstSec5SystemOnly" runat="server" RepeatDirection="Horizontal"
                                                            onclick="rdblstSec5SystemOnly_SelectedIndexChanged();">
                                                           
                                                            <asp:ListItem Text="Yes" Value="Yes" />

ASP.NET, HTML, JavaScript Snippet Support (VS 2010 and .NET 4.0 Series)

  
This post covers another useful improvement in VS 2010 - HTML/ASP.NET/JavaScript snippet support. Snippets allow you to be more productive within source view by allowing you to create chunks of code and markup that you can quickly apply and use in your application with a minimum of character typing.

Visual Studio has supported the concept of "snippets" for VB and C# in previous releases - but not for HTML, ASP.NET markup and JavaScript. With VS 2010 we now support snippets for these content types as well.

call JavaScript - jQuery code from ASP.NET Server-Side

  
jQuery got so close to me lately that I can see myself adding the scripts to my project almost unconsciously. The thing is, jQuery is very useful for me, in almost all situations and it has been a do or die enhancement for all my project since I first put my hands on it.

Of course while using it, you encounter few situations which need a bit of research to solve, mostly when you are trying to combine it with some other technologies like: UpdatePanels and ASP.NET Ajax. For instance there are many situations when I would like to run some jQuery magic based on some decision that I make on the server side.

call JavaScript - jQuery code from ASP.NET Server-Side

  
jQuery got so close to me lately that I can see myself adding the scripts to my project almost unconsciously. The thing is, jQuery is very useful for me, in almost all situations and it has been a do or die enhancement for all my project since I first put my hands on it.

Of course while using it, you encounter few situations which need a bit of research to solve, mostly when you are trying to combine it with some other technologies like: UpdatePanels and ASP.NET Ajax. For instance there are many situations when I would like to run some jQuery magic based on some decision that I make on the server side

Ajax Enabled Gridview using JavaScript in ASP.NET

  
Before explaining the article, I would like to thank all readers who read my article and voted for it. Your appreciation for my article gives me strength to write more good articles. Hope in future I will get your valuable comments and suggestions. Now I won't waste your time and come back to the topic. I have written this article on 'Ajax Enabled Gridview Using JavaScript in ASP.NET'. In this article, I will show you how to make a Gridview using a simple HTML table, JavaScript and XML HTTP for Ajax call without using any ASP.NET control.

Using Code

GridView Javascript Click Row and Ajax

  
This article shows 2 common tasks with the ASP.NET GridView: Binding a List (generic) of objects as DataSource and on clicking a row, getting the values of the selected row by a javascript function. In the example a List with User-objects is displayed. On clicking a row containing the data of a User-object, the Id of the object is used to get the address of the user by an Ajax-call and display it in a details-field.
Categories: 
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