473,549 Members | 4,476 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Word Count in Firefox

11 New Member
I built a form that is depentent on a word count a word count. What I have works just fine in IE but doesn't work in Firefox. It changes the count from 0 to 1 and that's as far as it goes. Here's what I'm doing.
Expand|Select|Wrap|Line Numbers
  1. <script type=text/javaScript>
  2. <!--
  3.  
  4. function word_count(val) {
  5. val = val.split(/\s+/g);
  6. document.form.op3.value = val.length;
  7. }
  8.  
  9. //-->
  10. </script>
  11.  
  12. <form name="form">
  13.  
  14. <textarea onkeyup="word_count(this.innerHTML)" name="adtext" rows="12" cols="85"></textarea>
  15. <br />
  16. <p>Word Count:
  17. <input readonly="readonly" size="3" value="0" name="op3" /></p>
  18. </form>
Does anyone know what I can do to make it work in Firefox? I haven't tried it in anything else, so if there's a universal fix, that would be helpful!
May 22 '07 #1
4 2517
dmjpro
2,476 Top Contributor
i think this.innerHTML this is the problem.

though i m not very much familiar with FIREFOX... actually our project is IE speciifc .
this is for private GOV. company.

yet i think this is the bug in ur code.
change it to this.value i think this ll work for both.

have a good day.

kind regards.
dmjpro.
May 22 '07 #2
FunkHouse9
11 New Member
It looks like your suggestion fixed my problem. I can't thank you enough!
May 22 '07 #3
dmjpro
2,476 Top Contributor
that depends on u....

kind regards.
dmjpro.
May 22 '07 #4
harryngh
1 New Member
I suggest a word count add-on that might help your writing if you use Chrome
https://chrome.google.com/webstore/d...idojhfddflblcm
if you use Firefox:
https://addons.mozilla.org/en-US/fir...ord-count-tool


if you want a fast & reliable solution, you can go to its web version:
Word Count
Dec 13 '14 #5

Sign in to post your reply or Sign up for a free account.

Similar topics

2
4519
by: Martin Lucas-Smith | last post by:
I am trying to use PHP's COM support to open a URL from within MS Word then save the document. I am using PHP5.0.3/Apache2/WindowsXP. phpinfo() confirms that COM support is enabled. Manually, this would be: - Start MS Word (am using Office 2003)
5
7640
by: jester.dev | last post by:
Hello, I'm learning Python from Python Bible, and having some problems with this code below. When I run it, I get nothing. It should open the file poem.txt (which exists in the current directory) and count number of times any given word appears in the text. #!/usr/bin/python
8
2424
by: scorpion53061 | last post by:
My boss is more and more asking me to get into areas of report formatting and such with the primarily database apps that I write. I am not pleased with Crystal and some of the pitfalls I have seen with this particualar report tool. I would like to delve into Word automation ( I believe you can control page breaks and such with this). Can...
10
72663
by: Lorenzo Thurman | last post by:
I have a table cell that I want to wrap text inside of. I've tried both hard and soft wrap, but Firefox refuses to obey. IE 6&7 handle the wrap just fine. Does anyone know how I can fix this?
1
4203
by: vmoreau | last post by:
I have a text and I need to find a Word that are not enclosed in paranthesis. Can it be done with a regex? Is someone could help me? I am not familar with regex... Example looking for WORD: (there is a WORD in ( my string WORD )) and * WORD * to (find WORD) and * WORD * Should give me the to word between star (star ar not part of string)
4
12419
by: etuncer | last post by:
Hello All, I have Access 2003, and am trying to build a database for my small company. I want to be able to create a word document based on the data entered through a form. the real question is this: can Access create the document and place it as an OLE object to the relevant table? Any help is greatly appreciated. Ricky
1
2995
by: beanie | last post by:
i am a c programming beginner and i am trying to Create a concordance of Word Count for a text File in c programming but my code isn't working.please can u help me out.here is my code: #include <stdio.h> #include <ctype.h> #include <string.h> #include <stdlib.h> struct word { struct word *left; /* tree to the left */ struct word *right;...
2
4942
by: beanie | last post by:
i am a beginer in c programming and i am trying to Create a Concordance of Word Count for a Text File but my code is not working.pls can anyone helpme out.here is my code: #include <stdio.h> #include <ctype.h> #include <string.h> #include <stdlib.h> struct word { struct word *left; /* tree to the left */ struct word *right; /* tree to...
6
3359
by: boyindie86 | last post by:
Hi I have been fighting with this lump of code for the last week what I am trying to do is that I am passing words into passages of texts, and I want the system to go and find exact word matches only and place square brackets around them e.g word = car PASSAGE: the red car required a lot of care to prevent a scar I only want it to...
0
7723
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. ...
0
7962
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that...
0
7814
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the...
0
6050
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then...
0
5092
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert...
0
3486
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
1949
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
1
1063
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
0
769
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.