aish
09-09-2005, 01:23 AM
I want to validate asp.net textboxes,it should not allow to enter invalid characters,I used for javascript keycode to validate key code, and I call this javascript in codebehind page like this,
txtFirstName.Attributes.Add("onkeypress","return AlphaOnly();");
but my problem is when I copy and Paste these invalid characters to textbox it did not fire error message. then I used OnPaste and lostfocus event like this but it's not working,
txtFirstName.Attributes.Add("onPaste","return AlphaOnly();");
what can I do for this?
Thanks.
txtFirstName.Attributes.Add("onkeypress","return AlphaOnly();");
but my problem is when I copy and Paste these invalid characters to textbox it did not fire error message. then I used OnPaste and lostfocus event like this but it's not working,
txtFirstName.Attributes.Add("onPaste","return AlphaOnly();");
what can I do for this?
Thanks.