The forums ran from 2008-2020 and are now closed and viewable here as an archive.

Home Forums JavaScript changing the frame of a form field when on it?

  • This topic is empty.
Viewing 5 posts - 1 through 5 (of 5 total)
  • Author
  • #34559


    As a bit a of a beginner to using javascript my problem is I’m currently using the script below to have the text ‘USERNAME’ within the field until the user alters it but I also want to achieve changing the frame colour of the field when the users tabs into it – can this be done within this script or do I need to add more code to my CSS?

    Any help would be greatly appreciated.



    you can do this via css with the :focus pseudo selector


    Karim, here’s my CSS, how should I alter it?

    #member-login-form { width: 165px; margin-right: 10px; margin-left: 10px; }

    #member-login-form label { margin: 0; padding: 0; width: 50px; }

    #member-login-form input { color: #999; font-size: 0.7em; font-weight: bold; font-style: normal; background-color: #eeeef0; text-decoration: none; text-align: left; letter-spacing: 0.1em; width: 161px; margin: 0 0 8px; padding: 6px 0 6px 4px; border: solid 1px #cccbcb; }

    #member-login-form input.submit { font: bold 11px Tahoma, Arial, Helvetica, sans-serif; color: #fff; width: 165px; height: 37px; margin: 4px 0 10px; padding: 0; border:none; }



    #member-login-form input:focus {
    border-color: #;

    You’re an absolute star!

Viewing 5 posts - 1 through 5 (of 5 total)
  • The forum ‘JavaScript’ is closed to new topics and replies.