C# Tutorials and offshore development in India
    Tutorials   Resources   Forum   Reviews   Communities   Interview   Jobs   Projects   Training   Your Ad Here    
Silverlight Games | Mentor | Code Converter | Articles | Code Factory | Computer Jokes | Members | Peer Appraisal | IT Companies | Bookmarks | Polls | Revenue Sharing | Lobby | Gift Shop |


Prizes & Awards
My Profile



Active Members
TodayLast 7 Days more...






Forums » .NET » JavaScript »

Delete key doesn't work for textbox keypress event


Posted Date: 11 Nov 2008      Posted By: Giri Subramanian      Member Level: Bronze     Points: 1   Responses: 1



Hi,
For my textbox i am firing keypress event.So if the user can change any value in the textbox this event want to fire.It is work fine for all the keys except delete key.When i delete anything in this textbox using delete key this keypress event doesn't fire.
What is the problem here? Give me the suggestion.

Thanks,
Giri





Responses

Author: Kumar    12 Nov 2008Member Level: GoldRating: 2 out of 52 out of 5     Points: 2

Hi,

Use this javascript ,it just display the ASCII code for the Key pressed.Just take that ascii code do according to your requirements.

<script language="javascript" type="text/javascript">
function KeyPressed(){
document.onkeydown = keydown;
function keydown(evt){
if (!evt) evt = event;
alert(evt.keyCode);
return false;
}
}
</script>

<input type="text" id="txttest" name="txttest" onkeypress="KeyPressed();" />



Thanks&Regards,

Dhilipkumar



Post Reply

 This thread is locked for new responses. Please post your comments and questions as a separate thread.
If required, refer to the URL of this page in your new post.


Next : How create Treeview Node Rightclick Context Menu in Javascript
Previous : how to generate java code for ip change
Return to Discussion Forum
Post New Message
Category: JavaScript

Related Messages



dotNet Slackers

About Us    Contact Us    Privacy Policy    Terms Of Use