Hi all,
I have Two Textboxes in ASp.net Web page
once i enter 2 letters in the first textbox then the focus of cursor should in the other textbox.
ple help me out in the above problem..
Thanks
SathishIf TextBox1.Text.Length = 2 Then
TextBox2.Focus()
End IfOr thereabouts :D
Wouldn't that require a postback for every time a key is pressed in the text box?
This can be done by JS, which wouldn't require any postback.
Alas, I am not good at JS and do not know what it would be off the top of my head.
Woka
Try this:
Include in text box tag: onkeyup="countChar()"
Then have this javascript function:
function countChar()
{
var t1 = document.getElementById('txtTextBox1');
If t1.value.length == 2
{
var t2 = document.getElementById('txtTextBox2');
t2.focus();
}
}
This is off the top of my head but it should be there or there abouts.
Wouldn't that require a postback for every time a key is pressed in the text box?
This can be done by JS, which wouldn't require any postback.
Alas, I am not good at JS and do not know what it would be off the top of my head.
WokaIndeed it can...but like yourself I know next to nothing about JavaScript :D
Subscribe to:
Post Comments (Atom)
0 comments:
Post a Comment