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 Maciej Los 225
1 Sergey Alexandrovich Kryukov 167
2 _Amy 155
3 CHill60 130
4 Manfred R. Bihy 130
0 OriginalGriff 7,320
1 Sergey Alexandrovich Kryukov 6,043
2 Maciej Los 3,754
3 Peter Leow 3,448
4 CHill60 2,572


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

CodeProject, 503-250 Ferrand Drive Toronto Ontario, M3C 3G8 Canada +1 416-849-8900 x 100