Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > ASP .Net > ASP .Net Web Controls > Trying to get an asp:Checkbox to display an alert when the person clicks it.

Reply
Thread Tools

Trying to get an asp:Checkbox to display an alert when the person clicks it.

 
 
Mufasa
Guest
Posts: n/a
 
      07-25-2007
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.


 
Reply With Quote
 
 
 
 
marss
Guest
Posts: n/a
 
      07-26-2007
On 25 , 22:38, "Mufasa" <(E-Mail Removed)> 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

 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Trying to cut a person out of a foreground & pasting into adifferent background Eric Prilovich Digital Photography 24 01-03-2013 10:46 PM
How to display the path if someone clicks a hyperlink or button that moves to a page that is not in the SiteMap. AAaron123 ASP .Net 0 05-15-2009 01:25 AM
Not a Ruby person but trying to help a newbie Cheryl Cepak Ruby 2 12-02-2008 05:49 AM
Clicks and double-clicks PontiMax ASP .Net Datagrid Control 2 07-14-2004 11:00 AM
ALERT: Virus Scam Alert! Toronto Garage Door Company Computer Support 1 11-18-2003 04:16 PM



Advertisments