Printable Version of Topic

Click here to view this topic in its original format

HTMLHelp Forums _ Client-side Scripting _ Disable the Comma key in a aspx page

Posted by: krish Oct 17 2006, 08:42 AM

Hi All,


How to disable Comma key press in a aspx page using java script?

Thanks


Posted by: Christian J Oct 17 2006, 09:42 AM

http://www.javascriptkit.com/javatutors/javascriptkey.shtml might help, though it seems Windows Opera8+ returns keycode number 44 for the comma key on my computer while IE6 and Firefox return number 188. Don't know if other OSs are different. Then there's the comma key on the num pad.

And you must still check the submitted data in the server-side script, in case the user has disabled javascript in the browser.

Posted by: Darin McGrew Oct 17 2006, 12:03 PM

And of course, there are other ways to input a comma character.

Posted by: Brian Chandler Oct 18 2006, 07:45 AM

QUOTE(krish @ Oct 17 2006, 10:42 PM) *

Hi All,


How to disable Comma key press in a aspx page using java script?

Thanks


Strictly, you can't "disable" any key. If you told us what you are really trying to do, you might get a better answer...


Powered by Invision Power Board (http://www.invisionboard.com)
© Invision Power Services (http://www.invisionpower.com)