.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 funtion working in FF but not in IE

Posted By:      Posted Date: September 08, 2010    Points: 0   Category :ASP.Net
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); },

View Complete Post

More Related Resource Links

Enable Go Button after entering data in all fields using javascript funtion


Hi friends,

My page is having one gridview with check boxes,two textboxes and one button just like this see this link now i want to enable go button whenever user has select checkbox in gridview and he needs to enter text in two textboxes. i have written onkeyup event for two textboxes to test whether user enter text in textboxes or not but i am unable to write javascript function to check whether user has selected checkbox in gridview or not to enable go button .My requiremnet is user need to enter three inputs select atleast one checkbox in gridview and he needs to enter text in two textboxes.please friends pls tell me how to write javascript function to find whether user has selected the checkbox in gridview or not

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 funtion in the href property does not accepted


I try to add the following code in a sharepoint 2010 web page

<a href="javascript:function();"> This is a test</a>

but each time I save it, the line disappear. What is wrong with the code??



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

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

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

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)







Onchange event for datetime field in javascript is not working?


I want to compare start date and end date when start date is changed. If start date is big, on change event i need to make the end date the same as start date.

So I wrote On change event for start date. But it doesnot work  

getField('input','Start Time').onchange = function() {showEndDate()};


function showEndDate()



var date1 = getField('input','Start Time');

var date2 = getField('input','End Time');


but its not firing at all. So you guys have any idea or any other way to do for datetime on change event?

javascript not working in sharepoint Public IPhosted site ?




Can AnyBody guide me why Javascript is not functioning in my hosted site with Public IP and i had 3rd party tools using the javascript which they were displaying but functionality.


Pls help me to resolve this !!!!

Thanks in Advance !!! Cheers !!! Praveen Mandalapu

Javascript on CreateUserWizard GridView not working


I would like a total calculation on a GridView column. Here is my code that isn't working. Where am I going wrong? The calculation should be done on GridView2 TextBox13 and the Total should be in TextBox14. I'm not getting the calculation in TextBox14. The problems are in Wizard Step 3. Any help would be greatly appreciated.


Codebehind Code:

Protected Sub GridView2_RowDataBound(ByVal sender As Object, ByVal e As System.Web.UI.WebControls.GridViewRowEventArgs) Handles GridView2.RowDataBound

        If e.Row.RowType = DataControlRowType.DataRow And e.Row.RowState = DataControlRowState.Edit Then
            CType(e.Row.FindControl("TextBox13"), TextBox).Attributes.Add("onkeyup", "calculateSubTotal")
        End If
    End Sub


ASPX Code:

<%@ Page Title="" MasterPageFile="~/design/NoRightBarMaster.master" AutoEventWireup="false" CodeFile="ApplicantSetup.aspx.vb" Inherits="Secure_ApplicantSetup" %>

<asp:Content ContentPlaceHolderID="SheetContentPlaceHolder" Runat="Server">

Javascript allert inside AJAX UpdatePanel not working


I am having problems with alert box not popup when I'm using AJAX UpdatePanel. The following is what I have and it's not working.

1    ClientScriptManager csm = Page.ClientScript;
3    if(!csm.IsStartupScriptRegistered(this.GetType(), "winPop"))
4    {
5    	csm.RegisterStartupScript(this.GetType(), "winPop", "alert('Update is successful');", true);
6    }

I have to stress that the reason why it does not work is because I'm using AJAX UpdatePanel. If I turned off the AJAX UpdatePanel then it works perfectly. So does anyone have solution to go around this AJAX UpdatePanel issue?

reportviewer date parameter and calendar.. not working and javascript errors??



Hi, I've got this ssrs 2005 report that works great passing a few
security related parameters from asp.net codebehind. However, there
are two date related parameters that won't be coming from my web form,
but rather from the report form itself. When I test the report's date
parameters from visual studio it work fine, but when I attempt the
same report from a reportviewer no matter what input I place on the
report's date fields or even if I select the date picker, the report
simply resets to default and reloads. And actually the date picker
from the reportviewer does not not even pop up.


Here's my aspx code:

<%@ Page Language="VB" AutoEventWireup="false"
Inherits="_ReportViewer" MasterPageFile="~/Main/MasterPage.master"
    CodeFile="~/Reports/CashSales.aspx.vb"  Title="Cash Sales" %>

<%@ Register Assembly="Microsoft.ReportViewer.WebForms,
Version=, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a"
    Namespace="Microsoft.Reporting.WebForms" TagPrefix="rsweb" %>

<asp:Content ID="Content1" ContentPlaceHolderID="Content1"

javascript textbox clear not working



i have javascript to clear the textbox but its not working and js called asshipping.js

below the code i have in asshipping

function clear() {
function clearfields() {
    O('TextBox1').value = '';
    O("TextBox2").value = '';
    O('TextBox3').value = '';

function O(id)
  return document.getElementById(id);

default.aspx page

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<html xmlns="http://www.w3.org/1999/xhtml" >
<head runat="server">
    <title>Untitled Page</title>

   <script src="Script1/asshipping.js" type="text/javascript"></script>
<body  >
    <form id="form1" runat="server"  >

        <asp:Button ID="Button1" runat=&q

AJAX AsyncFileUpload Javascript functions not working


<asp:Content ID="Content1" ContentPlaceHolderID="HeadContent" Runat="Server">
<script language="javascript" type="text/javascript">
    function uploadError(sender, args) {
        document.getElementById('lblStatus').innerText = args.get_fileName(), "<span style='color:red;'>" + args.get_errorMessage() + "</span>";

    function StartUpload(sender, args) {
        document.getElementById('lblStatus').innerText = 'Uploading...';

    function UploadComplete(sender, args) {
        var filename = args.get_fileName();
        var contentType = args.get_contentType();
        var text = "" + filename + "          |           " + args.get_length() + " bytes";
        document.getElementById('lblStatus').innerText = text;

<asp:Content ID="Content2" ContentPlaceHolderID="MainContent" Runat="Server">

<asp:ToolkitScriptManager ID="ToolkitScriptManager1" runat="server">
        <asp:AsyncFileUpload ID="AsyncFileUpload1" runat="server" 

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) {
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