Click here to Skip to main content
15,892,072 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Hi,

a button inside aspx page as below,

ASP
<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

JavaScript
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
Updated 23-Dec-12 17:38pm
v5
Comments
AshishChaudha 22-Dec-12 3:40am    
Share the code block of Javascript please

 
Share this answer
 
Comments
hasbina 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
Top Experts
Last 24hrsThis month


CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900