Much appreciated, worked fine. I should have remembered that was the
correct event name from old days.
> The events you're attaching to (OnTextChanged and
OnSelectedIndexChanged)
are server-side events. You'll need to use the client-side "OnChange"
event
for both of these elements ... like this:
TextBox.Attributes.Add("onchange", "alert('Text as changed');")
Dropdownlist.Attributes.Add("onchange", "alert('Text as
changed');")
----Original Message Follows----
From: "Sean Marchiafava" <smarch@c...>
Reply-To: "ASPX_Professional" <aspx_professional@p...>
To: "ASPX_Professional" <aspx_professional@p...>
Subject: [aspx_professional] Client-side event handler for textbox and
dropdownlist
Date: Thu, 20 Mar 2003 17:55:18
Has anyone had succes attaching a client-side inline javascript handler
for an event fired from a textbox or dropdownlist.
I am using the following code and the events do not fire.
TextBox.Attributes.Add("OnTextChanged", "alert('Text as changed');")
Dropdownlist.Attributes.Add("OnSelectedIndexChanged", "alert('Text as
changed');")
Same code works fine for a button.
Thanks
Sean
---
Change your mail options at http://p2p.wrox.com/manager.asp or
to unsubscribe send a blank email to
_________________________________________________________________
STOP MORE SPAM with the new MSN 8 and get 2 months FREE*
http://join.msn.com/?page=features/junkmail