Prevent entry of punctuation

Discussion in 'ASP General' started by PW, Jun 18, 2006.

  1. PW

    PW Guest

    Hi,

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

    TIA,
    PW
     
    PW, Jun 18, 2006
    #1
    1. Advertising

  2. PW

    Evertjan. Guest

    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)
     
    Evertjan., Jun 18, 2006
    #2
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Replies:
    0
    Views:
    4,060
  2. AtomicBob
    Replies:
    14
    Views:
    937
    Toby Inkster
    May 2, 2006
  3. PW
    Replies:
    10
    Views:
    964
    Jonathan N. Little
    Jun 18, 2006
  4. Mike Owen

    Allowing entry of a Carriage Return during data entry

    Mike Owen, Jul 27, 2006, in forum: ASP .Net Web Controls
    Replies:
    3
    Views:
    749
    Alessandro Zifiglio
    Jul 27, 2006
  5. Noozer
    Replies:
    2
    Views:
    279
    Dr John Stockton
    Aug 1, 2005
Loading...

Share This Page