can u change the color background of a text box when it has been changed/edited by the user?

Discussion in 'Javascript' started by libsfan01, Apr 14, 2006.

  1. libsfan01

    libsfan01 Guest

    How/can you do this?

    kind regards

    marc rice
    libsfan01, Apr 14, 2006
    #1
    1. Advertising

  2. libsfan01

    Evertjan. Guest

    libsfan01 wrote on 14 apr 2006 in comp.lang.javascript:

    > How/can you do this?


    [Please always repeat your question in the text and do not use sms
    shortenings on usenet]

    > "can u change the color background of a text box when it has been

    changed/edited by the user?"

    <style>
    input { background-color:expression(value!=defaultValue?"cyan":"");}
    </style>

    This is IE-only.

    =============================================

    cross browser:

    <input
    value='start'
    onkeyup='this.style.backgroundColor=
    (value!=defaultValue)?"cyan":""'>

    --
    Evertjan.
    The Netherlands.
    (Please change the x'es to dots in my emailaddress)
    Evertjan., Apr 14, 2006
    #2
    1. Advertising

  3. libsfan01

    Hal Rosser Guest

    "libsfan01" <> wrote in message
    news:...
    > How/can you do this?


    <input
    onchange="this.style.backgroundColor=(this.value=='')?'yellow':'white';" />
    Hal Rosser, Apr 14, 2006
    #3
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Sunil Menon

    How to find if a field has been edited?

    Sunil Menon, Nov 12, 2003, in forum: ASP .Net
    Replies:
    2
    Views:
    373
    Sunil Menon
    Nov 13, 2003
  2. =?Utf-8?B?UCBL?=

    DataGridView - Determine if a row has been edited

    =?Utf-8?B?UCBL?=, Apr 20, 2006, in forum: ASP .Net
    Replies:
    1
    Views:
    858
    =?Utf-8?B?UGhpbGxpcCBXaWxsaWFtcw==?=
    Apr 20, 2006
  3. loga123
    Replies:
    2
    Views:
    310
    loga123
    May 20, 2006
  4. M Wells
    Replies:
    3
    Views:
    104
    Randy Webb
    Nov 5, 2004
  5. Replies:
    0
    Views:
    221
Loading...

Share This Page