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.

Making Javascript word count box have a different text input colour

View previous topic View next topic Go down

Solved Making Javascript word count box have a different text input colour

Post by LostLegend on October 16th 2011, 1:08 pm

I'm not THAT good with Javascript/html/css but this word count box has a white background and my forum has a black background. This consequently means that the text that is entered on my forum is white, and it blends in with this word count box. I need the input text to be black.

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="20" 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"></p>
      </center></div></div></td>
    </tr>
  </table>
</form>

Thanks if you can help with this!

EDIT: http://naruto-role-play-rpg.forumotion.com/
Forgot.

LostLegend
Forumember

Posts : 922
Reputation : 22
Language : English

http://naruto-role-play-rpg.forumotion.com/

Back to top Go down

Solved Re: Making Javascript word count box have a different text input colour

Post by True Blue on October 16th 2011, 1:33 pm

Hello LostLegend

Try adding the bold text after <table bgcolor="black"

Good luck

Liz

True Blue
Forumember

Female Posts : 63
Reputation : 4
Language : english
Location : N.Ireland

Back to top Go down

Solved Re: Making Javascript word count box have a different text input colour

Post by LostLegend on October 16th 2011, 2:17 pm

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 bgcolor="black" border="0" cellspacing="0" cellpadding="0">
    <tr>
      <td width="100%"><textarea rows="12" name="wordcount2" cols="20" 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"></p>
      </center></div></div></td>
    </tr>
  </table>
</form>

No effect.

LostLegend
Forumember

Posts : 922
Reputation : 22
Language : English

http://naruto-role-play-rpg.forumotion.com/

Back to top Go down

Solved Re: Making Javascript word count box have a different text input colour

Post by True Blue on October 16th 2011, 2:21 pm

Hello LostLegend

It's not the background colour you need; as your board already has "black" change the new bgcolor from black to yellow and you'll get a better idea.

You might need to made a new code centered around this code in bold text below.

<table id="shell" bgcolor="black" border="1" height="20" width="30">
<tr><td>
<table id="inner" bgcolor="yellow" height="50" width="50">
<tr><td>text</td></tr>
</table>
</td></tr></table>

If I get the time later I'll look into it for you.

Liz

Update:

Try this set colours to suit.

<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 bgcolor="black" border="0" cellspacing="0" cellpadding="0">
<tr>
<td width="100%"><textarea style="background:#99FFFF" rows="12" name="wordcount2" cols="20" 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"></p>
</center></div></div></td>
</tr>
</table>
</form>



True Blue
Forumember

Female Posts : 63
Reputation : 4
Language : english
Location : N.Ireland

Back to top Go down

Solved Re: Making Javascript word count box have a different text input colour

Post by LostLegend on October 16th 2011, 3:22 pm

Woohoo! It worked! Thanks!

LostLegend
Forumember

Posts : 922
Reputation : 22
Language : English

http://naruto-role-play-rpg.forumotion.com/

Back to top Go down

Solved Re: Making Javascript word count box have a different text input colour

Post by Nera. on October 16th 2011, 4:17 pm

Lock

Nera.
Energetic

Female Posts : 7077
Reputation : 2013
Language : English
Location : -

http://webartzforum.com

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