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 7458433
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 29, 20262026-05-29T13:26:48+00:00 2026-05-29T13:26:48+00:00

I want to do a front end control on the size of user inputs

  • 0

I want to do a front end control on the size of user inputs before they are loaded into a VARCHAR(1000) table. How should I do that given that I expect inputs in Latin and Asian character sets?

  • 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-29T13:26:49+00:00Added an answer on May 29, 2026 at 1:26 pm

    If your varchar field size is 1000. First don’t let user to type more than 1000 characters. You can control this from the front end.

    If you have have a txtField you can use maxlenght

    <input type="text" name="txtName" id="txtName" maxlength="1000" />
    

    And if you use text area you can use following kind of code

    <script language="javascript" type="text/javascript">
    
    function imposeMaxLength(Object, MaxLen)
    {
      return (Object.value.length < MaxLen);
    }
    
    </script> 
    <textarea name="txtxDesc" id="txtDesc" onkeypress="return imposeMaxLength(this, 1000);" ></textarea>
    

    If you think advance user may cause problems by modifying DOM elements using tools. You have to validate this from server side as well using PHP.

    if(strlen($_POST["txtxDesc"]) > 1000)
    {
       echo "Text length is too much".
       exit;
    }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I want to move my Microsoft Access Database front end into source control for
I want to control the NodeInspector Front-End. It is itself designed to control Node.js
I want to Switch from Web Designer to Front End Developer or web developer
I want use JQuery mobile for the front-end of my mobile application, but I
I want to store the positions of some elements on the front-end(jQuery) in the
How to change the front end language for a WordPress site? I want to
What I want to do is to create a simple front-end post submit form,
I'm writing a simple browser-based front end that should be able to launch a
I want the window to be always in front of all of the app
I want to insert many rows in front of the last row in a

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.