• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 14963
  • Last Modified:

How to add Onkeyup event in a textbox control???

html input tag have onkeyup event, do server textbox tag have this event??? i means:

<asp:TextBox id="txtHoLot" runat="server" Width="152px" BackColor="#FFFFC0" onkeyup = ...></asp:TextBox>
0
duclee
Asked:
duclee
1 Solution
 
sajuksCommented:
Try this
txtHoLot.Attributes.Add("onKeyUp", "Javascript:document.forms[0].txtHoLot1.focus();")
0
 
sukumar_diyaCommented:
Hi,
server Textbox has only the .TextChanged event. You can use the javascript function to handle the keypress. You can specify the function name in the attributes like TextBox1.Attributes.Add("onKeyUp","HandleKeyUp(this)");

Suku
0
 
ducleeAuthor Commented:
thanks, its ok now
0
What does it mean to be "Always On"?

Is your cloud always on? With an Always On cloud you won't have to worry about downtime for maintenance or software application code updates, ensuring that your bottom line isn't affected.

 
sajuksCommented:
Thanks for the points and grade
0
 
mmarinovCommented:
Hi duclee,

just in addition to the sukumar_diya, the javascript is case sensitive and the name of the event is onkeyup

Regards!
B..M
mmarinov
0
 
ducleeAuthor Commented:
yes, I know, thanks for your comment
0
 
tan_manojCommented:
i have two text boxes which gives the user option to enter his account number as first 4 digits in textbox1 and second 4 digit in textbox2. now i want the focus to automatically move to textbox2 when textbox1 reaches its maxlength , how can i do that?
0

Featured Post

Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Tackle projects and never again get stuck behind a technical roadblock.
Join Now