Sign In| Join
Get Help:Ask a Question in our Forums|Report a Bug|More Help Resources
Last post Apr 27, 2012 10:04 AM by Sunny ali
Member
177 Points
133 Posts
Apr 27, 2012 09:48 AM|LINK
i have a check box that is in gird
i want when i check and uncheck the check box i want to hit a function on client side my function is
function cbChange(cb) { var cbid = cb.id;
alert("chckecbox" + cbid);
}
Contributor
3026 Points
564 Posts
Apr 27, 2012 09:53 AM|LINK
hi,
you can use anClientClick or onclick function
for ex:
<asp:CheckBox ID="headerBOQ" runat="Server" ToolTip="check to select all" onclick="selectAll()" />Select All
<script language="javascript" type="text/javascript">
function selectAll() { alert("test"); } </script>
Star
7625 Points
1454 Posts
Add onclick attribute to Checkbox markup and include the javascript function that you'd like to call
<asp:CheckBox ID="chkExpiraTresDias" runat="server" onclick="alert('Foo')" />
Apr 27, 2012 09:58 AM|LINK
<asp:TemplateField> <ItemTemplate> <asp:CheckBox ID="cbStatus" runat="server" onclick="cbChange(this)" /> </ItemTemplate>
onclick not working
5925 Points
1115 Posts
Sunny ali onclick="cbChange(this)"
Try onchange instead of onclick
Apr 27, 2012 09:59 AM|LINK
Santosh i want to pass check box value for that as a paramter
your alert function is not working as well
Apr 27, 2012 10:04 AM|LINK
thanks for reply Nikhil V
onchange working but the id of checkbox is null
function cbChange(cb) { var cbid = cb.id
cb.id getting null
Sunny ali
Member
177 Points
133 Posts
checkbox event onclick="cbChange(this)" not fire
Apr 27, 2012 09:48 AM|LINK
i have a check box that is in gird
i want when i check and uncheck the check box i want to hit a function on client side my function is
function cbChange(cb) {
var cbid = cb.id;
alert("chckecbox" + cbid);
}
Please 'Mark as Answer' if this post helps you
sujithkumar
Contributor
3026 Points
564 Posts
Re: checkbox event onclick="cbChange(this)" not fire
Apr 27, 2012 09:53 AM|LINK
hi,
you can use anClientClick or onclick function
for ex:
<asp:CheckBox ID="headerBOQ" runat="Server" ToolTip="check to select all" onclick="selectAll()" />Select
All
<script language="javascript" type="text/javascript">
function selectAll()
{
alert("test");
}
</script>
santosh.jagd...
Star
7625 Points
1454 Posts
Re: checkbox event onclick="cbChange(this)" not fire
Apr 27, 2012 09:53 AM|LINK
Add onclick attribute to Checkbox markup and include the javascript function that you'd like to call
<asp:CheckBox ID="chkExpiraTresDias" runat="server" onclick="alert('Foo')" />MCP
Sunny ali
Member
177 Points
133 Posts
Re: checkbox event onclick="cbChange(this)" not fire
Apr 27, 2012 09:58 AM|LINK
<asp:TemplateField>
<ItemTemplate>
<asp:CheckBox ID="cbStatus" runat="server" onclick="cbChange(this)" />
</ItemTemplate>
onclick not working
Please 'Mark as Answer' if this post helps you
niksv
Contributor
5925 Points
1115 Posts
Re: checkbox event onclick="cbChange(this)" not fire
Apr 27, 2012 09:58 AM|LINK
Try onchange instead of onclick
Sunny ali
Member
177 Points
133 Posts
Re: checkbox event onclick="cbChange(this)" not fire
Apr 27, 2012 09:59 AM|LINK
Santosh i want to pass check box value for that as a paramter
your alert function is not working as well
Please 'Mark as Answer' if this post helps you
Sunny ali
Member
177 Points
133 Posts
Re: checkbox event onclick="cbChange(this)" not fire
Apr 27, 2012 10:04 AM|LINK
thanks for reply Nikhil V
onchange working but the id of checkbox is null
function cbChange(cb) {
var cbid = cb.id
}
cb.id getting null
Please 'Mark as Answer' if this post helps you