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

  • Home
  • SEARCH
  • 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 9145273
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 17, 20262026-06-17T10:28:26+00:00 2026-06-17T10:28:26+00:00

I am using a jquery character counter and integrating it with my form helpers

  • 0

I am using a jquery character counter and integrating it with my form helpers in Codeigniter.I’ve got everything working as it should, however when I’m using this script, parentheses are not showing up. I typed them in and used the ascii codes, and they only show up when I take off the script.

Any idea what this maybe?

thanks in advance.

javascript:

<script>
    function updateCountdown_mylife() {
        var remaining = 1340 - jQuery('.message_mylife').val().length;
        jQuery('#mylife').text(remaining + ' characters remaining.');
    }

    jQuery(document).ready(function($) {
        updateCountdown_mylife();
        $('.message_mylife').change(updateCountdown_mylife);
        $('.message_mylife').keyup(updateCountdown_mylife);
    });

    function updateCountdown_occupation() {
        var remaining = 200 - jQuery('.message_occupation').val().length;
        jQuery('#occupation').text(remaining + ' characters remaining.');
    }

    jQuery(document).ready(function($) {
        updateCountdown_occupation();
        $('.message_occupation').change(updateCountdown_occupation);
        $('.message_occupation').keyup(updateCountdown_occupation);
    });
    </script>

html:

My Life <br /><span class="title_sub_text">Tell us a about yourself</span> <span class="edit_sub_text" id="mylife">&#40;1350 character limit&#41;</span>

textarea:

<div class="edit_text_area">        
            <?php 

            if(empty($user['mylife']))
            {
                $data = array('name' => 'mylife', 'class' => 'message_mylife');
                echo form_textarea($data);
            }
            else
            {
                $data = array('name' => 'mylife', 'class' => 'message_mylife');
                echo form_textarea($data, $user['mylife']);
            }


            ?>
        </div>

thans in advance

  • 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-06-17T10:28:28+00:00Added an answer on June 17, 2026 at 10:28 am

    If I understand what you are saying then the parenthesis are not showing up because you are overwriting the span text and not putting the parenthesis there while over-writing. For example, shouldn’t the relevant code in updateCountdown_mylife be modified as

    jQuery('#mylife').text('(' + remaining + ' characters remaining)');
    

    Note the parenthesis included within. Also to display (1350 character limit) at start-up, just comment out updateCountdown_mylife call in start-up code i.e.

    jQuery(document).ready(function($) {
            // updateCountdown_mylife(); // this line would modify span text at start-up
            $('.message_mylife').change(updateCountdown_mylife);
    

    I have modified JS fiddle with these changes – check it out here: http://jsfiddle.net/GjRYL/1/ – hopefully, this is what you are after.

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

Sidebar

Related Questions

This question is an extension of jQuery Character Counter using class? . I would
I'm using jQuery plugin called charCount to display a character counter for some textareas,
When parsing json using jQuery.parseJSON(), I get this error SyntaxError: JSON.parse: bad control character
I'm running into a character encoding issue when I load a dropdown using jQuery
Please i need to change color of a single character in textarea using JQuery.
I'm using quicklfip ( http://jonraasch.com/blog/quickflip-2-jquery-plugin ) for Chinese character flashcards. The front panel will
am using jquery tablesorter plugin and in my country column i got special characters
I am trying to remove the last character from a div id using jQuery.
i am using jquery ui autocomplete in my tag textbox , its working fine
I'm trying to make Jeditable works on new elements created using this jquery file

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.