Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 9 of 9
  1. #1
    Regular Coder
    Join Date
    Dec 2003
    Posts
    107
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Text Field Colors Question

    Hello,
    Right now, on my page, I have text fields that are white, & when you click into the text fields, they turn from white to green.

    How can I have them change colors from green to white?

    Here Is My Page

    This Site Has What I Am Speaking About In Red, On The Left (Scroll Down)


    Thanks,
    Dan

  • #2
    Regular Coder
    Join Date
    Jul 2003
    Location
    Massachusetts
    Posts
    472
    Thanks
    0
    Thanked 0 Times in 0 Posts
    No JavaScript required.
    Code:
    <style type="text/css">
    /*<![CDATA[*/
    	input:focus {
    		background-color: #090;
    	}
    /*]]>*/
    </style>

  • #3
    Regular Coder
    Join Date
    Dec 2003
    Posts
    107
    Thanks
    0
    Thanked 0 Times in 0 Posts
    I tried that, but it didn't seem to work... I did try to copy the code that www.Taschen.com used.

    I was able to make the TEXT FIELDS always green, but when clicking around the page, the TEXT FIELDS sometimes change back to white.

    Please help me to always have green.

    Also, the 3rd search is now showng an error.


    THANKS FOR THE HELP,
    Dan

  • #4
    Regular Coder
    Join Date
    Jul 2002
    Posts
    698
    Thanks
    0
    Thanked 0 Times in 0 Posts
    ur fields all 3 of them has this in them

    style="background-Color=#CCFF99" onFocus="this.style.backgroundColor='#CCFF99'" onBlur="this.style.backgroundColor='#CCFF99'"

    if u replaced that with
    style="background-color :#CCFF99;"

    they should stay that green color

  • #5
    Regular Coder
    Join Date
    Dec 2003
    Posts
    107
    Thanks
    0
    Thanked 0 Times in 0 Posts
    Garadon...

    I tried that, but they are turning white.

    Are you certain that your code is right? Also, did it work for you?

    Plus, how come I have an error in the last search?


    THANKS SO MUCH!!!
    Dan

  • #6
    Regular Coder
    Join Date
    Jul 2002
    Posts
    698
    Thanks
    0
    Thanked 0 Times in 0 Posts
    try replacing ur highlight function

    Code:
    var oldbackgroundColor;
    //Function to highlight form element
    function highlight(e)
    {
      eventobj=ns6? e.target : event.srcElement
      if (previous!='')
    	{
        if (checkel(previous))
          previous.style.backgroundColor=oldbackgroundColor;
        previous=eventobj;
        oldbackgroundColor=previous.style.backgroundColor;
        if (checkel(eventobj))
         eventobj.style.backgroundColor=highlightcolor;
      }
      else
    	{
        if (checkel(eventobj))
          eventobj.style.backgroundColor=highlightcolor;
      previous=eventobj
      }
    }

  • #7
    Regular Coder
    Join Date
    Dec 2003
    Posts
    107
    Thanks
    0
    Thanked 0 Times in 0 Posts
    Garadon...


    YOU F*CKING GENIUS!!!


    Now, can you help me with the "error" that is showing up in the last search?



    Thanks!!!!!!!!!!!!!!!!!
    Dan

  • #8
    Regular Coder
    Join Date
    Jul 2002
    Posts
    698
    Thanks
    0
    Thanked 0 Times in 0 Posts
    in the input field for that search u have this
    onclick="cleartext(this)"

    either remove it or make a function called that.

  • #9
    Regular Coder
    Join Date
    Dec 2003
    Posts
    107
    Thanks
    0
    Thanked 0 Times in 0 Posts
    King Garadon...

    Is it possible to add the "Clear Text" thing only to my first TEXT BOX? I added a Clear Text Function, but it doesn't seem to work.

    Also, the errors are gone!!!



    THANKS 1,000,000%!!!
    Dan


  •  

    Posting Permissions

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