Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7430065
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 29, 20262026-05-29T09:04:49+00:00 2026-05-29T09:04:49+00:00

<asp:TextBox ID=CommentBox runat=server TextMode=multiLine CssClass=commentTbx onKeyDown=limitText(this,200); onKeyUp=limitText(this,200);valid(this);></asp:TextBox>&nbsp; function valid(f) { !(/^[A-zÑñ0-9-\s]*$/i).test(f.value)?f.value = f.value.replace(/[^A-zÑñ0-9-\s]/ig,”):null; }

  • 0
<asp:TextBox ID="CommentBox" runat="server" TextMode="multiLine" CssClass="commentTbx" onKeyDown="limitText(this,200);" onKeyUp="limitText(this,200);valid(this);"></asp:TextBox>&nbsp;

 function valid(f) {
!(/^[A-zÑñ0-9-\s]*$/i).test(f.value)?f.value = f.value.replace(/[^A-zÑñ0-9-\s]/ig,''):null;
} 

Hi above is my javascript function, but i want to allow commas, space and fullstop ONLY! How is it possible?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-29T09:04:50+00:00Added an answer on May 29, 2026 at 9:04 am
    <script language="javascript" type="text/javascript">
    function check(e) {
    var keynum
    var keychar
    var numcheck
    // For Internet Explorer
    if (window.event)
    {
    keynum = e.keyCode
    }
    // For Netscape/Firefox/Opera
    else if (e.which)
    {
    keynum = e.which
    }
    keychar = String.fromCharCode(keynum)
    //List of special characters you want to restrict
    if (keychar == "'" || keychar == "`")
    {
    
    return false;
    }
    else {
    return true;
    }
    }
    </script>
    
    <asp:TextBox ID="txtName" runat="server" onkeypress="return check(event)" ></asp:TextBox>
    

    hope this helps

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a simple asp:textbox set up like this <asp:TextBox runat=server ID=tbxWarning TextMode=MultiLine Rows=4>
I have a multiline textbox : <asp:TextBox ID=txtBody runat=server TextMode=MultiLine Rows=10 Width=95% /> In
I have a single asp:textbox declared as follows: <asp:TextBox ID=textBox1 class=myTB runat=server TextMode=MultiLine Font-Names=Calibri
<asp:Textbox runat=server Id=Username /> This might render as: <input type=text id=ctl00_mainContent_Username /> But in
<asp:TextBox ID=txt_Subject runat=server CssClass=txt_box></asp:TextBox> <asp:RequiredFieldValidator ID=valSubjectRequired ControlToValidate=txt_Subject ErrorMessage=Subject is a required field. EnableClientScript=true Display=None
Given a textbox: <asp:Textbox runat=server id=txtAddress1 /> This renders as something similar to: <input
I have three TextBox controls on the page <asp:TextBox ID=TextBox1 runat=server AutoPostBack=True OnTextChanged=TextBox_TextChanged TabIndex=1>
I have an ASP TextBox with TextMode set to MultiLine. I'm having problems with
<asp:TextBox ID=Textboxtotalamount OnTextChanged=AmountChanged Width=90px AutoPostBack=true runat=server> </asp:TextBox> <asp:RequiredFieldValidator ID=RequiredFieldValidator runat=server ControlToValidate=Textboxtotalamount SetFocusOnError=True ValidationGroup=val>*</asp:RequiredFieldValidator> <asp:RegularExpressionValidator
I have a textbox and a dropdownlist the textbox has <asp:TextBox ID=TxtInizioPeriodo runat=server ontextchanged=InizioPeriodo_TextChanged

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.