How to put JS on TextBox...correctly?

  • Thread starter Thread starter Amil
  • Start date Start date
A

Amil

I have code that adds Javascript to a textbox:

txtbox.Attributes.Add("onKeyDown", "myJScode");

When I look at the actual source, the JS code is placed inside of a <span>
tag directly before the actual <input> tag. How can I make sure the JS is
applied/added to the <input> tag?? The <span> tag must be added by
..NET.

Amil
 
Oops, I meant to say a CheckBox...not TextBox. TextBox works correctly, but
adding JS
to a CheckBox creates the <span> from .NET.
 
Back
Top