I'm guessing you mean that you want to have the textboxes change background color, or be bolded, or something as the user tabs through/selects the different controls?
Here's one way you can do it:
Check out this thread: thread855-396964
Here's how I'd change the code there to work in your case:
Only take a control object in, no need for a boolean. THe control object it needs to be passed is the page first (so in the calling code, you just put ThisFunction(Me)).
Now, in the part where I actually have the objTextControl having its properties set, what you're going to want to code is:
objTextControl.Attributes.Add("onFocus", "do this"
objTextControl.Attributes.Add("onBlur", "do this"
Not 100% if those are the javascript commands, but you get the picture: each textbox will get an attribute added for when it gets focus (change the backcolor, bold, etc.) and when it loses focus (reset defaults).
This way, when the client is tabbing through the text controls, the javascript will already be written and the client code will do all the changes for you.
However, when I run this javascript code on a asp:Textbox control. I get a javascript error saying object does not support this. I would like to select the contents of the text box so that the user can begin typing and over write the previous value.
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.