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
Well there is a great solution. Instead of using it in document .ready work like this
And you script should contain this
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