Advertisement
If you have a new account but are having problems posting or verifying your account, please email us on hello@boards.ie for help. Thanks :)
Hello all! Please ensure that you are posting a new thread or question in the appropriate forum. The Feedback forum is overwhelmed with questions that are having to be moved elsewhere. If you need help to verify your account contact hello@boards.ie
Hi there,
There is an issue with role permissions that is being worked on at the moment.
If you are having trouble with access or permissions on regional forums please post here to get access: https://www.boards.ie/discussion/2058365403/you-do-not-have-permission-for-that#latest

on blur change text box colour???

  • 09-07-2002 4:08pm
    #1
    Registered Users, Registered Users 2 Posts: 706 ✭✭✭


    on blur change text box colour???

    Anyone know how to do it? That when a user selects clicks into a text box, the "class" changes to another value which has a different background colour set. I tried a view javascripts like change property in Dreamweaver MX but to no avail. Anyone know the actual script as I am not a javascript writer.

    Thanks

    Dave :)


Comments

  • Registered Users, Registered Users 2 Posts: 706 ✭✭✭DJB


    I got a nice script that does what i need above for anyone that is interested.....

    <html>
    <head>
    <script language="javascript">
    <!--
    function changeColor(obj,color){
    obj.style.backgroundColor = color;
    }
    //-->
    </script>
    </head>
    <body>
    <form>
    <input type="text" style="background-color:red;" name="itembox" onFocus="changeColor(this, 'red')" onBlur="changeColor(this, 'blue')">
    <br>
    <input type="text">
    </form>

    </body>
    </html>

    Compliments of "aegiskleais" - www.udzone.com member.

    Regards,

    Dave


  • Moderators, Social & Fun Moderators Posts: 28,633 Mod ✭✭✭✭Shiminay


    I'd have changed the class - less maintainence over time. So you'd have something like
    function changeColor(obj){
      obj.className="theNewClass";
      }
    


  • Closed Accounts Posts: 2,695 ✭✭✭b20uvkft6m5xwg


    Thx for that UDZONE link DJB

    Looks promising :)


Advertisement