Click here to Skip to main content
Rate this: bad
good
Please Sign up or sign in to vote.
See more: ASP.NET
Hi,
 
a button inside aspx page as below,
 
 
   <asp:ImageButton ID="removeButton" runat="server"  OnClick="removeStudentInformation" OnClientClick="return checkBoxselectedornot()" ImageUrl="~/image/remove-selected-button.png" /> 
 

But it's onclientclick doesn't work in firefox.how to solve?
 
javascript as below
 
function checkBoxselectedornot() {
 
       
        var valid = false;
        var gridview = document.getElementById("studentInformationGrid");
 
        for (var i = 0; i < gridview.all.length; i++) {
            var node = gridview.all[i];
            if (node != null && node.type == "checkbox" && node.checked) {
                valid = true;
                break;
            }
        }
        if (!valid) {
            alert("Invalid. Please select a student to continue.");
        }
 
        return valid;
 

}
 
 
Thanks..
Posted 21-Dec-12 19:39pm
hasbina1.2K
Edited 23-Dec-12 17:38pm
v5
Comments
AshishChaudha at 22-Dec-12 3:40am
   
Share the code block of Javascript please
Rate this: bad
good
Please Sign up or sign in to vote.

Solution 1

  Permalink  
Comments
hasbina at 22-Dec-12 7:12am
   
where write the below code?
 
removeButton.OnClientClick = String.Format("ElementStyle(document.getElementById('wrapper'),'display','none'); {0}; return false;", Page.ClientScript.GetPostBackEventReference(removeButton, ""));

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)

  Print Answers RSS
0 CHill60 360
1 Sarvesh Kumar Gupta 248
2 OriginalGriff 218
3 Sergey Alexandrovich Kryukov 158
4 RyanDev 120


Advertise | Privacy | Mobile
Web02 | 2.8.140709.1 | Last Updated 23 Dec 2012
Copyright © CodeProject, 1999-2014
All Rights Reserved. Terms of Service
Layout: fixed | fluid