How to put JS on TextBox...correctly?

Tech-Archive recommends: Repair Windows Errors & Optimize Windows Performance

From: Amil (amilhanish_at_hotmail.com)
Date: 04/01/04


Date: Thu, 1 Apr 2004 13:01:13 -0700

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



Relevant Pages


... that if I only got to the <span>, I could easily access the innerHTML ... function getElementsByClass (theClass, node, tag) { ... are accessing the Array instance instead of the element object. ...
(comp.lang.javascript)