Making Javascript word count box have a different text input colour Hitskin_logo Hitskin.com

This is a Hitskin.com skin preview
Install the skinReturn to the skin page

The forum of the forums
Would you like to react to this message? Create an account in a few clicks or log in to continue.
3 posters

    Making Javascript word count box have a different text input colour

    LostLegend
    LostLegend
    Forumember


    Posts : 922
    Reputation : 23
    Language : English

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

    Post by LostLegend 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.
    True Blue
    True Blue
    Forumember


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

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

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

    Hello LostLegend

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

    Good luck

    Liz
    LostLegend
    LostLegend
    Forumember


    Posts : 922
    Reputation : 23
    Language : English

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

    Post by LostLegend 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.
    True Blue
    True Blue
    Forumember


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

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

    Post by True Blue 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>


    LostLegend
    LostLegend
    Forumember


    Posts : 922
    Reputation : 23
    Language : English

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

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

    Woohoo! It worked! Thanks!
    Nera.
    Nera.
    Energetic


    Female Posts : 7078
    Reputation : 2017
    Language : English
    Location : -

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

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

    Lock