Jul 24, 2008

Counting Characters Of Textarea...

Free Web Hosting, No Ads > CONTRIBUTE > Computers > Programming Languages > PHP Programming

free web hosting

Counting Characters Of Textarea...

alexia
good day webmasters...

i am in need of a script that will count the inputted characters one will enter... i mean the script must count the number of characters in a textarea as i am entering characters to the textarea..

i know the logic but i cant translate it yet in PHP... so i hope you can help me...

thanks a lot in advance... blink.gif

Reply

guangdian
yes,it must be a very simple php script ..i just learning php but i just can not answer it for you.you see,that,your way of using php is not a normal way.i just didn't meet it before.Good luck.
Guangdian

Reply

rvalkass
There is a PHP function that counts the number of characters in a string: strlen($variable_to_count);

I am not sure how you could use this 'live'. If anyone could enlighten me, guangdian and alexia on how to include this 'live' we would be very greatful.

Reply

HmmZ
First of all, if your going to attempt to halt further character inputs, there's a much easier way (maxlength="").

as for your "real-time length-check"..:
link

It's a long page, but just scroll to the bottom (Header="Real-time" JavaScript check)

Hope this helps..

Reply



Got an Opinion! Express your Views! (no registration):-
Add your Reply/ Opinion/ Views/ Comments/ Suggestion/ Questions/ Queries etc.
Posts with decent grammar & English will be accepted and please refrain from profanities.
For asking a Question, We recommend you to sign-up (for free) so that you can track the topic easily.

Nature of your Post*: Opinion/ Reply/ Comments
Question/Query
Feedback to us.
       
Name   Email
Title/Question*

(Maximum characters: 10,000)
You have characters left.
Confirm Code:

Similar Topics

Keywords : counting characters textarea

  1. Converting Textarea Return Characters To <br /> - (8)
    Hi guys, I have set up a form with a textarea. If I have text on multiple lines such as: CODE
    here is some content here is some more content then when I print it out as html it will be
    returned on one line like so: CODE here is some contenthere is some more content When i
    look at the content in the database it looks just like the original way i entered it (contains the
    multiple lines). Is there a function in php so that when i spit it out in html it retains the
    multiple line format? Thanks in advance. ...
  2. How Would I Go About Making A Simple "counting" Script? - (3)
  3. Counting Variables? - (4)
    Write a php script that will accept a positive integer, if it is even, divide it by 2 and if it is
    odd, multiply it by 3 and add 1. Repeat the process until the value is 1, printing out each value.
    Finally print out how many of these operations you performed. If the input value is less than 1,
    print error and perform an exit(); For example: Initial value: 9 Next value: 28 Next value: 14
    Next value: 7 Next value: 22 Next value: 11 Next value: 34 Next value: 17 Next value: 52 Next
    value: 26 Next value: 13 Next value: 40 Next value: 20 Next value: 10 Next value: 5 Nex...
  4. Validation Script - Detecting Illegal Characters - preg_match to find illegal characters (0)
    I'm trying to validate a user's desired username for a registration page. I want to detect
    any illegal characters being used for a username. So far i have managed to include most execpt the
    '\', the '\' is used for escape and treating the preceding characters
    literally. I try to do '\\' but i get an error because it execects another
    character. CODE $ck_result = "Default"; $pattern =
    "/[!|@|#|$|%|^|&|*|(|)|_|\-|=|+|\||,|.|\/|;|:|\'
    ;|\"|&#...
  5. Php Escaped Control Characters And Windows - they aren't working for me. (3)
    In php coding, when you escape certain characters, they have an impact on the output of an
    echo'd or printed string. ie "\r\n\t" should give you a new line and a tab before
    outputting the content for a line of printing. They vary by OS, I know, but I have tried all the
    variations I can think of and can't seem to control output using them. Believe me, I have tried
    multiple variations and nothing works for me. I have checked the php.ini file for settings but I
    can't find where you can modify them. So the question is : Where do i look to conf...
  6. Converting Characters In A Variable To Individual Values In An Array - turning variables into arrays (2)
    Say I have a variable such as $nav_item and it had to contents Home . IE: CODE
    $nav_item = 'Home'; How would I make so that $nav_item was an array and
    had the following contents? CODE $nav_item = array ('h', 'o',
    'm', 'e'); With the case changing (ie H would become h and U
    would become u ) EDIT: Okay found out that I could change the case with
    array_change_key_case ($nav_item, CASE_LOWER); ...
  7. Max Characters Is X? - (3)
    I am currently making a code for my phpBB forum, where it will import the latest topics from a
    specific forum, and display it on the news section of my main page. But the width of that news
    section is very tiny, so I want the code to limit the numbers of characters to 25. So, let's
    say this is the full title: "This is the title which is a little too long so it needs to be
    shortened." This is what I want to show: "This is the title which ..." How can I do that?...



Looking for counting, characters, textarea

Searching Video's for counting, characters, textarea
advertisement



Counting Characters Of Textarea...



 

 

 

 

ADD REPLY / Got an Opinion! Remove these ADs! RAPID SEARCH! Free Web Hosting [X]
Express your Opinions, Thoughts or Contribute more info. to help others.
Ask your Doubts & Queries to get answers, So that "Together We can help others!"
Register FREE for AD-FREE forum, Create your own topics, Ask Questions, track topics, setup subscriptions & notifications and Get a Free Website w/ Email and FTP.
500MB Space *No Ads*, CPanel, FTP, PHP, MySQL, EMails - 100% FREE