Add an event to a textbox at runtime
I am working on a site in which I must make a text box that cannot allow numbers to be entered. My only problem is that I cannot insert an onKeyPress or onKeyDown event into the input tag itself, I must do this elsewhere in my code.
Any help with this would be appreciated
If this is any help here is what I have so far, this page does exactly what I want it to do, the onKeyPress event must be somewhere in the script though
var charCode = (evt.which) ? evt.which : event.keyCode
if (charCode > 31 && (charCode < 48 || charCode > 57))
<INPUT name="box1" onkeypress="return isNumberKey(event)" type="text">
Users Browsing this Thread
There are currently 1 users browsing this thread.
(0 members and 1 guests)
Tags for this Thread