开发者

Is there any alternate way for CheckBox onClick Event in JavaScript?

开发者 https://www.devze.com 2023-04-07 21:21 出处:网络
I have written one JavaScript function which would rise the event when the User clicks the CheckBox. But I have already written some other function which too has to rise when the user clicks the Chec

I have written one JavaScript function which would rise the event when the User clicks the CheckBox.

But I have already written some other function which too has to rise when the user clicks the CheckBox. I included that function on onClick event like below:

<asp:CheckBox ID="chkSelect" runat="server" Checked=开发者_运维技巧'<%#Bind("Select") %>' onClick="CheckedTotal();" />

But now I want to include another function called "EnableLink" into that onClick event of the CheckBox. How to include this function to the CheckBox? I have tried to combine both the function as a single one. But it has become a complex one for me. So Is there any alternate way for this?


Lots of ways to do this..quickest one

<asp:CheckBox ID="chkSelect" runat="server" Checked='<%#Bind("Select") %>' onClick="CheckedTotal(); EnableLink(); MoreClick();" />


This will Help you,

<asp:CheckBox ID="chkSelect" runat="server" Checked='<%#Bind("Select") %>' onClick="CheckedTotal();EnableLink();" />


1) .. onClick="CheckedTotal();myFn();" ..

2) .. onClick="someFn();" ..

 <script>
    function someFn(){
       CheckedTotal();
       myFn();
    }
 </script>

3) in onload of the window/page

document.getElementById('myCheckboxID').addEventListener('click', myFn,false);

UPDATE: myFn() = EnableLink();

0

精彩评论

暂无评论...
验证码 换一张
取 消