checkbox event onclick="cbChange(this)" not firehttp://forums.asp.net/t/1797649.aspx/1?checkbox+event+onclick+cbChange+this+not+fireFri, 27 Apr 2012 10:04:20 -040017976494954577http://forums.asp.net/p/1797649/4954577.aspx/1?checkbox+event+onclick+cbChange+this+not+firecheckbox event onclick="cbChange(this)" not fire <p>i have a check box that is in gird</p> <p>i want when &nbsp;i check and uncheck the check box i want to hit a function on client side my function is</p> <p>function cbChange(cb) {<br> var cbid = cb.id;</p> <p>&nbsp;alert(&quot;chckecbox&quot; &#43; cbid);</p> <p>}</p> 2012-04-27T09:48:41-04:004954587http://forums.asp.net/p/1797649/4954587.aspx/1?Re+checkbox+event+onclick+cbChange+this+not+fireRe: checkbox event onclick="cbChange(this)" not fire <p>hi,</p> <p>you can use anClientClick or onclick function</p> <p>for ex:</p> <p>&nbsp; &lt;asp:CheckBox ID=&quot;headerBOQ&quot; runat=&quot;Server&quot; ToolTip=&quot;check to select all&quot; onclick=&quot;selectAll()&quot; /&gt;Select<br> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; All</p> <p></p> <p>&nbsp;&lt;script language=&quot;javascript&quot; type=&quot;text/javascript&quot;&gt;</p> <p>&nbsp;&nbsp; function selectAll()<br> &nbsp;&nbsp;&nbsp; {<br> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; alert(&quot;test&quot;);<br> &nbsp;&nbsp;&nbsp; }<br> &nbsp;&nbsp; &nbsp; <br> &nbsp;&nbsp; &nbsp;<br> &nbsp;&nbsp;&nbsp; &lt;/script&gt;</p> 2012-04-27T09:53:38-04:004954590http://forums.asp.net/p/1797649/4954590.aspx/1?Re+checkbox+event+onclick+cbChange+this+not+fireRe: checkbox event onclick="cbChange(this)" not fire <p>Add onclick attribute to Checkbox markup and include the javascript function that you'd like to call</p> <pre class="prettyprint">&lt;asp:CheckBox ID=&quot;chkExpiraTresDias&quot; runat=&quot;server&quot; onclick=&quot;alert('Foo')&quot; /&gt;</pre> <p></p> 2012-04-27T09:53:58-04:004954603http://forums.asp.net/p/1797649/4954603.aspx/1?Re+checkbox+event+onclick+cbChange+this+not+fireRe: checkbox event onclick="cbChange(this)" not fire <p>&lt;asp:TemplateField&gt;<br> &lt;ItemTemplate&gt;<br> <br> &lt;asp:CheckBox ID=&quot;cbStatus&quot; runat=&quot;server&quot; onclick=&quot;cbChange(this)&quot; /&gt;<br> <br> &lt;/ItemTemplate&gt;</p> <p></p> <p>onclick not working</p> 2012-04-27T09:58:07-04:004954604http://forums.asp.net/p/1797649/4954604.aspx/1?Re+checkbox+event+onclick+cbChange+this+not+fireRe: checkbox event onclick="cbChange(this)" not fire <p></p> <blockquote><span class="icon-blockquote"></span> <h4>Sunny ali</h4> onclick=&quot;cbChange(this)&quot;</blockquote> <p></p> <p>Try <strong>onchange</strong> instead of onclick</p> 2012-04-27T09:58:47-04:004954605http://forums.asp.net/p/1797649/4954605.aspx/1?Re+checkbox+event+onclick+cbChange+this+not+fireRe: checkbox event onclick="cbChange(this)" not fire <p><strong><span>Santosh &nbsp;i want to pass check box value for that as a paramter</span></strong></p> <p><strong><span>your alert function is not working as well</span></strong></p> 2012-04-27T09:59:17-04:004954614http://forums.asp.net/p/1797649/4954614.aspx/1?Re+checkbox+event+onclick+cbChange+this+not+fireRe: checkbox event onclick="cbChange(this)" not fire <p>thanks for reply&nbsp;<span>Nikhil V</span></p> <p>onchange working but the id of checkbox is null</p> <p>function cbChange(cb) {<br> var cbid = cb.id</p> <p>}</p> <p>cb.id getting null</p> 2012-04-27T10:04:20-04:00