Re: Trying to get an asp:Checkbox to display an alert when the person clicks it.
On 25 , 22:38, "Mufasa" wrote:
> I have a situation where I need to display an alert when somebody clicks a
> check box. I was able to get it to work with a plain <input> but when I try
> and do it with an <asp:CheckBox> I can't get the javascript right.
>
> Anybody have any thoughts?
>
> TIA - Jeff.
<asp:CheckBox ID="CheckBox1" runat="server" ....
Code behind:
protected void Page_Load(object sender, EventArgs e)
{
...
CheckBox1.Attributes.Add("onclick", "alert('clicked');");
Regards,
Mykola
Date:Thu, 26 Jul 2007 06:26:40 -0700
Author:
|