How to put JS on TextBox...correctly?

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
 
A

Amil

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

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,769
Messages
2,569,580
Members
45,055
Latest member
SlimSparkKetoACVReview

Latest Threads

Top