I have asp imagebutton in my page. By default i am loading disabled image. and have set the property of Enabled = false in the page. On Change of any field value in the page i am making the disabled image as enabled as below. After this if I click on Enabled image it is not firing OnCLientClick javascript method. Why? Any body please help me.
On load of the Screen
<asp:ImageButton ID="imgbtnOk" runat="server" ImageUrl="~/Images/btn_ok_disabled.gif"
OnClientClick="return ValidateInformation()" AccessKey="O" ToolTip="OK" TabIndex="30" />
On updatation of any field in the screen following javascript has been fired to enable the button
//Enables the Ok button if user selects any Carrier Plan Code
function EnableOk() {
var cboCarrierPlanCode = document.getElementById(radcboCarrierPlanCode)
if (cboCarrierPlanCode.value != "") {
var updateflag = document.getElementById(hdnChangeFlag)
updateflag.value = 1;
var imgBtnOk = document.getElementById(imgbtnOk)
imgBtnOk.disabled =
false
imgBtnOk.src =
"../Images/btn_OK.gif"
}
}
After this image is getting enabled but initially for the control i have written OnClientClick event to validate some more fields in the screen.... this is not getting fired.
WHY?