Click here to Skip to main content
15,903,201 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
i can not access the first letter of the text box when calling a java script function
in the text box key press event
Posted
Comments
_Amy 3-Oct-12 2:40am    
Which code you are using? We are not having access to your HDD. So, while asking the question please try to incorporate your sample code in the question. So that we can understand your question and solve the problem.
Arunprasath Natarajan 4-Oct-12 10:58am    
Place your code here.

provide more details about your problem.i think you get problem while accessing keypressed character when key is pressed first time according to this i am providing you following a soln:

XML
.aspx code
<asp:TextBox ID="txtUserId" runat="server" onkeyPress="return myfunction(event)></asp:TextBox>

javascript:
function myfunction(e)
{
    var a=e.keyCode;
}



}

this e.keyCode gives you key pressed.i hope it will works
 
Share this answer
 
Comments
Nikhil Paulson 3-Oct-12 2:57am    
i want to perform a percentage validation,so i want to check whether the entered value is greater than 100 or not
Samsani.v.s.Durga Prasad 4-Oct-12 8:54am    
write e.keychar in keyup event of textbox
can u tell what code r u using ?
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900