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?
 
Back
Top