473,412 Members | 2,081 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,412 software developers and data experts.

Word Count in Firefox

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 2503
dmjpro
2,476 2GB
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
It looks like your suggestion fixed my problem. I can't thank you enough!
May 22 '07 #3
dmjpro
2,476 2GB
that depends on u....

kind regards.
dmjpro.
May 22 '07 #4
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
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. ...
5
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...
8
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...
10
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
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:...
4
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...
1
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...
2
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>...
6
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...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
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...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
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...
0
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,...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...
0
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...

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.