Button Color on focus

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?
 
M

Manish

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
 
I

id10t error

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?
 
M

Manish

Hi,

You can set the Onfocus event for each control and call the function to
change the color of each control when that control recieves the focus.

Regards,
Manish

www.ComponentOne.com
 

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

Members online

No members online now.

Forum statistics

Threads
473,780
Messages
2,569,611
Members
45,265
Latest member
TodLarocca

Latest Threads

Top