Button Color on focus

  • Thread starter Thread starter id10t error
  • Start date Start date
I

id10t error

Hello,

I am making an ASP.NET page to run on a handheld scanner. The screen
is pretty small and when you use the tab button to move from button it
is hard to tell what button the tab index is on. Is there a way to
change the color of the button when that button was tabbed too?
 
Hi,

You can try the following code to set the background color on the textBox
control when the focus is on that control.

<html xmlns="http://www.w3.org/1999/xhtml" >
<head runat="server">
<title>Untitled Page</title>
<script type="text/javascript">

function setColor()
{
document.getElementById("Text1").style.backgroundColor = "#00FFFF"
}
</script>
</head>
<body>
<form id="form1" runat="server">
<div>
<input id="Text1" style="z-index: 100; left: 47px; position:
absolute; top: 92px"
type="text" onfocus="setColor()" />

</div>
</form>
</body>
</html>

Regards,
Manish
www.ComponentOne.com
 
Hi,

You can try the following code to set the background color on the textBox
control when the focus is on that control.

<html xmlns="http://www.w3.org/1999/xhtml" >
<head runat="server">
    <title>Untitled Page</title>
    <script type="text/javascript">

    function setColor()
    {
    document.getElementById("Text1").style.backgroundColor = "#00FFFF"
    }
     </script>
</head>
<body>
    <form id="form1" runat="server">
    <div>
        <input id="Text1" style="z-index: 100; left: 47px; position:
absolute; top: 92px"
            type="text" onfocus="setColor()" />

    </div>
    </form>
</body>
</html>

Regards,
Manishwww.ComponentOne.com






- Show quoted text -

Manish,


Where would I put this code?
 

Ask a Question

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

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top