Home All Groups Group Topic Archive Search About

Prevent entry of punctuation



Author
18 Jun 2006 1:17 AM
PW
Hi,

Is there anyway to format a text input box to prevent any punctuation marks
from being entered?

TIA,
PW

Author
18 Jun 2006 7:48 AM
Evertjan.
PW wrote on 18 jun 2006 in microsoft.public.inetserver.asp.general:
> Is there anyway to format a text input box to prevent any punctuation
> marks from being entered?

Not with serverside [ASP] code.
Text input boxes only exist clientside.
that is OT on this NG.

However, once the result has arrived on the server,
any string manipulation is possible:

<%
response.write result & "<br>"
%>

<script language='jscript' runat='server'>
  result = request.form('mybox').replace(/\W+/g,'')
</script>

--
Evertjan.
The Netherlands.
(Please change the x'es to dots in my emailaddress)

AddThis Social Bookmark Button