Web Analytics Made Easy -
StatCounter text counter and paging - CodingForum

Announcement

Collapse
No announcement yet.

text counter and paging

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • text counter and paging

    could anyone help me.

    I want to allow user type as many character as they want.

    what i want to do is,

    1-when the user enter the character, it will count the total character entered.
    2-example, maximum character allow is 100 which is fall under 1st message. i want the program allow the user enter more than 100 character but character number 101 will be count as a 2nd message..

  • #2
    I think you would be better off storing the whole message in one record, then paging the message afterwards rather than storing multiple records. Is this what you mean?
    http://curtdotnet.blogspot.com/

    Comment


    • #3
      The code that you need for the text count is here:

      <script language="javascript" type="text/javascript"><!--

      function counter() {

      var num=document.forms.formW.title.value;

      document.getElementById('count').innerHTML = num.length;

      if(num.length >= 30) {
      alert("You have met and or exceeded the maximum text allowed for your content page.\nAmount entered: " + num.length + " characters.");
      }
      }
      //--></script>


      It needs small changes and if you need help contact me!
      You will count the characters and when the message reaches the limit you restart the counter or continue with the caracter but inside the message you will put some escape character and afterwards you will know how many messages are there in that string and if you want them to be shown as separate (or send, or whatever you wish) you'll use the escape character that you will coose. For putting and reading corctly the escape character you'll need another script!

      As long as I am concerned it would be better to store the messages whole not segments and using the escape character as I described to you above!

      Comment

      Working...
      X