I have this form, that when i open my notepad there is the lists of my links,
I copy it from notepad then paste all the links in the textarea then it should count.
But what im trying to solve is that, when i do copy and paste it will automatically count not when i enter.
My codes are below to explain what my works.
jQuery Code
jQuery.fn.wordCount = function(params) {
var p = { counterElement:"display_count" };
var total_words;
if(params) {
jQuery.extend(p, params);
}
//for each keypress function on text areas
this.keypress(function() {
total_words=this.value.split("\n").length;
jQuery('#'+p.counterElement).html(total_words);
});
};
$(document).ready(function(){
$('#txtLinks').wordCount();
});
my Form
<form method="post">
<textarea name="texturl" rows="10" cols="20" id="txtLinks" class="textarea-addlinks"></textarea>
</form>
and the links are
http://09-flex-actionscript-it.gnstudio.com/index.php?title=Are_aware_of_the_Uncomplicated_strategies_to_post_sms_to_help_all_people
http://09-flex-actionscript-it.gnstudio.com/index.php?title=Below_To_acquire_pizza_hut_vouchers
http://09-flex-actionscript-it.gnstudio.com/index.php?title=Brand-new_business_model_innovation_specialists
http://09-flex-actionscript-it.gnstudio.com/index.php?title=Ery_at_times_a_good_Pizza_Express_Voucher_Are_usually_for_exciting
http://09-flex-actionscript-it.gnstudio.com/index.php?title=Gain_knowledge_of_on_the_subject_of_signs_of_depression
http://09-flex-actionscript-it.gnstudio.com/index.php?title=Get_yourself_a_dvd_swimming_pool_covers_currently
http://09-flex-actionscript-it.gnstudio.com/index.php?title=Simple_and_standard_symptoms_of_the_flu
http://09-flex-actionscript-it.gnstudio.com/index.php?title=Speaking_about_the_necessities_regarding_tinnitus_miracle:
http://09-flex-actionscript-it.gnstudio.com/index.php?title=The_best_places_to_secure_cheap_supplements_web_based
The count value should be 9.
Is there any way that there is no need to press enter i mean it will automatically count the links? By the way –how it counts? it count bye new link.
thanks guys
This seems to work: http://jsfiddle.net/js7Qn/
I used: