Results 1 to 6 of 6

Thread: textcolor!!

  1. #1

    Thread Starter
    Fanatic Member merhaba's Avatar
    Join Date
    Sep 2002
    Location
    Istanbul,Bartin-Gallipoli(Gelibolu-Canakkale)
    Posts
    601

    textcolor!!

    Hi there,
    the problem with the following script is that I can not change
    the font color and I can not move the "text box"
    hope you help me
    thanks
    //*********************
    <script>
    function write2()
    {
    document.for1.text1.value="HELLO my friends"
    document.bgColor="yellow";
    document.for1.buto1.value="up--up--+++";
    document.for1.buto2.value="down---down--";
    document.fontColor="blue";
    document.for1.text1.style.posLeft=document.for1.text1.style.posLeft=500;
    }
    </script>
    with my best wishes
    <br>
    <form name=for1>
    <input type=text name=text1 value="10" size=20><br>
    <input type=button name=buto1 value="up+++++"onclick="javascript:text1.value++"><BR>
    <input type=button name=buto2 value="DOWN--" onclick="javascript:text1.value--"><br>
    <input type=button name=buto3 value="yellow-hello" onclick="javascript:write2()"><br>
    <input type=button name=buto4 value="back to num" onclick="javascript:text1.value=10"><br>
    <input type=button name=buto5 value="refresh" onclick="javascript:location.reload()">
    </form>

  2. #2
    Frenzied Member Jop's Avatar
    Join Date
    Mar 2000
    Location
    Amsterdam, the Netherlands
    Posts
    1,986
    Code:
    document.style.backgroundColor="yellow";
    document.for1.text1.style.left=document.for1.text1.style.left=500;
    Jop - validweb.nl

    Alcohol doesn't solve any problems, but then again, neither does milk.

  3. #3
    Frenzied Member vbNeo's Avatar
    Join Date
    May 2002
    Location
    Jutland, Denmark
    Posts
    1,994
    Shouldn't it be

    Code:
    document.for1.text1.style.left=document.for1.text1.style.left+500;
    ?

    And I'd suggest giving it an ID and referencing it by that...
    "Lies, sanctions, and cruise missiles have never created a free and just society. Only everyday people can do that."
    - Zack de la Rocha


    Hear me roar.

  4. #4

    Thread Starter
    Fanatic Member merhaba's Avatar
    Join Date
    Sep 2002
    Location
    Istanbul,Bartin-Gallipoli(Gelibolu-Canakkale)
    Posts
    601

    this works ,too

    ---------------------------------------
    document.fgColor="red";
    --------------------------------------
    Last edited by merhaba; Sep 8th, 2004 at 12:09 PM.

  5. #5
    Frenzied Member Jop's Avatar
    Join Date
    Mar 2000
    Location
    Amsterdam, the Netherlands
    Posts
    1,986
    Yes, but I think you should stick to either using html or styles. So pick one and continue using that (i suggest styles, more forward compatible).
    Jop - validweb.nl

    Alcohol doesn't solve any problems, but then again, neither does milk.

  6. #6
    Frenzied Member Acidic's Avatar
    Join Date
    Sep 2003
    Location
    UK
    Posts
    1,090
    don't foget to add the "px" on the end of the style attributes.
    Have I helped you? Please Rate my posts.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width