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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 1, 20262026-06-01T15:31:44+00:00 2026-06-01T15:31:44+00:00

I have progress.js file which has the following code $(‘#text_area_input’).keyup(function() { var text_area_box =$(this).val();//Get

  • 0

I have progress.js file which has the following code

            $('#text_area_input').keyup(function()
            {
                var text_area_box =$(this).val();//Get the values in the textarea
                var max_numb_of_words = 160;//Set the Maximum Number of characters
                var main = text_area_box.length*100;//Multiply the lenght on words x 100
                var value= (main / max_numb_of_words);//Divide it by the Max numb of words previously declared
                var count= max_numb_of_words - text_area_box.length;//Get Count of remaining characters
                if(text_area_box.length <= max_numb_of_words)
                {
                    $('#progressbar').css('background-color','#5fbbde');//Set the background of the progressbar to blue
                    $('#count').html(count);//Output the count variable previously calculated into the div with id= count
                    $('#progressbar').animate(//Increase the width of the css property 'width'
                    {
                        'width': value+'%'
                    }, 1);//Increase the
                }
                else
                {
                    $('#progressbar').css('background-color','yellow');
                    //If More words is typed into the textarea than the specified limit ,
                    //Change the progress bar from blue to yellow
                    var remove_excess_characters =text_area_box.substr(0,max_numb_of_words);
                    $('#text_area_input').val(remove_excess_characters);
                    //Remove the excess words using substring
                }
                return false;
            });
        });

I have to call that function in my php file .
How could i make it right?
And I include all necessary css in my project

  • 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-01T15:31:46+00:00Added an answer on June 1, 2026 at 3:31 pm

    Well there is a great solution. Instead of using it in document .ready work like this

    <input type = 'button' onkeyup = 'my_function();' id = 'text_area_input'>
    

    And you script should contain this

     <script type = 'text/javascript'>
     function my_function(){
     // you code here
     }
     <script>
    

    if you are calling the other php file in this file this function will be available for the new php file too.
    The other solution is that copy the code in the other php file

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

Sidebar

Related Questions

All Gmail users should have already noticed that file upload progress bar has been
I have a questions.xml file which has a list of questions for my quiz,
I have the following javascript code, which is modified from the SimpleUpload demo in
I have a large file which has an enormous of data in it. I
I have this this code for Android which is stuck at the synchronized statement.
I have a progress bar which inherits from JSlider to provide highlighting functionality. Highlights
I have made some progress with the DataList and UserControl this morning but I
I posted a thread about this earlier and have made some progress but now
I have a ProgressBarWindow which has a progressbar and a cancel button on it
I have created a C# COM DLL which is essentially an enhanced progress bar

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.