|
-
November 25th, 2002, 01:42 PM
#1
Textbox question
Ok, so I have a textbox sitting right next to a checkbox on a webform. The textbox is disabled and grayed out by default. It needs to be enabled only when the checkbox is checked. No problem so far...
Part 2: This involves positioning the blinking cursor in the textbox, after the textbox has been enabled (saving the user a TAB to get to the textbox.. HUH!) 
Any ideas how to do this?
Thanks!!
-
November 26th, 2002, 06:35 AM
#2
This code snippet shows you:
Code:
if (checkBox1.checked)
{
textBox1.Enabled = true;
textBox1.Focus();
}
else
{
textBox1.Enabled = false;
}
Hope it helps!
-
November 26th, 2002, 01:36 PM
#3
No Focus() method for a TextBox...
I get the following compilation error:
'System.Web.UI.WebControls.TextBox' does not contain a definition for 'Focus'.
Am I missing something here?
Thanks!
-
November 26th, 2002, 01:38 PM
#4
Ah, my mistake for missing the webform. I believe this needs to be done with VBScript and not C# since it will require client-side code. I don't have any examples on this unfortunately.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|