The forum of the forums
Welcome to the Official Support Forum of Forumotion!

To take full advantage of everything offered by our forum, please log in if you are already a member, or join our community if you've not yet.



Create a free forum like this one.

Word Count Widget changes

View previous topic View next topic Go down

Solved Word Count Widget changes

Post by mooglefourteena on February 19th 2013, 10:45 pm

I have some script here which adds a word counter to the page.

Code:
<form method="POST" name="wordcount">
  <script language="JavaScript">

function countit(){

/*Word count script
By JavaScript Kit (http://javascriptkit.com)
Over 400+ free scripts here!
*/

var formcontent=document.wordcount.wordcount2.value
formcontent=formcontent.split(" ")
document.wordcount.wordcount3.value=formcontent.length
}
</script>
<table border="0" cellspacing="0" cellpadding="0">
    <tr>
      <td width="100%"><textarea rows="12" name="wordcount2" cols="60" wrap="virtual"></textarea></td>
    </tr>
    <tr>
      <td width="100%"><div align="right"><p><input type="button" value="Calculate Words"
      onClick="countit()"> <input type="text" name="wordcount3" size="20"></p>
      <div align="center"><center><p><font face="arial" size="-2">
      </center></div></div></td>
    </tr>
  </table>
</form>

What would I need to add to that code to make the box that you paste text into and the box which shows the word count into a different colour. Specifically, black.

CSS to change it would work too. Anything that works is good.

Help is mucho appreciated.

mooglefourteena
New Member

Posts : 13
Reputation : 1
Language : English

Back to top Go down

Solved Re: Word Count Widget changes

Post by mooglefourteena on February 20th 2013, 12:12 am

It creates a word counter, you paste your text and it tells you the number of words in the text.

mooglefourteena
New Member

Posts : 13
Reputation : 1
Language : English

Back to top Go down

Solved Re: Word Count Widget changes

Post by mooglefourteena on February 20th 2013, 12:26 am

It's a lot neater and works but has changed now to report the number of characters as opposed to the number of words.

mooglefourteena
New Member

Posts : 13
Reputation : 1
Language : English

Back to top Go down

Solved Re: Word Count Widget changes

Post by mooglefourteena on February 20th 2013, 12:40 am

Brilliant, it works. Thanks again!

mooglefourteena
New Member

Posts : 13
Reputation : 1
Language : English

Back to top Go down

View previous topic View next topic Back to top


 
Permissions in this forum:
You cannot reply to topics in this forum