I have followed your advice on supressing characters but I cant seem to supress the "." character.
Can anyone point me in the right direction as to how I can stop a user from entering the "." character in a textbox ?
Printable View
I have followed your advice on supressing characters but I cant seem to supress the "." character.
Can anyone point me in the right direction as to how I can stop a user from entering the "." character in a textbox ?
This seems to be working:
Code:<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<title>Untitled Document</title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<script type="text/javascript">
function get_rid_of_dots(obj) {
mystring = obj.value
regexp = /\./
mystring = mystring.replace(regexp,"")
obj.value = mystring
}
</script>
</head>
<body>
<input name="myTxt" type="text" id="myTxt" onKeyUp="get_rid_of_dots(this)">
</body>
</html>
THANK YOU
Will U marry me.
I have a lovely trailer !;)
Actually this regexp thin confuses the hell out of me.
whats with the" /\./" ?
Why the confusing "/\/" ?
What would regexp look like if I wanted to remove "." and "£" ?
Just curious. I think I had better do some client side study.
Ok, I had written a really large response to this, until I found out, I'm not really sure, I'll find some pages that clarify it for you (and me)
http://www.devshed.com/c/a/JavaScrip...RegExp-Object/
http://wsabstract.com/javatutors/redev.shtml
Thanks ACIDIC. I'll give the url's a good seeing to.:wave: