Wrox Programmer Forums
|
BOOK: ASP.NET 2.0 Website Programming Problem Design Solution ISBN: 978-0-7645-8464-0
This is the forum to discuss the Wrox book ASP.NET 2.0 Website Programming: Problem - Design - Solution by Marco Bellinaso; ISBN: 9780764584640
Welcome to the p2p.wrox.com Forums.

You are currently viewing the BOOK: ASP.NET 2.0 Website Programming Problem Design Solution ISBN: 978-0-7645-8464-0 section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old February 5th, 2008, 08:27 PM
Authorized User
 
Join Date: Jan 2007
Posts: 72
Thanks: 0
Thanked 0 Times in 0 Posts
Default quick one: onblur - text box highlight

Just a quick one.

TBH uses the onblur event to high light the textbox control that currently has focus.

Just found that if I set the BackColor of my textboxes in a skin file that this does not work.

Anyone else found this?

For my highlight I only want to change the border properties of the text box, not the background.

Tried:

.highlight {
border-color: #000000;
border-width: 2px;
}

but this does not work.

Any ideas? Not major but would be nice to get working.

Thanks,

Retro


 
Old February 5th, 2008, 10:57 PM
Authorized User
 
Join Date: Mar 2007
Posts: 39
Thanks: 0
Thanked 1 Time in 1 Post
Default

The problem is that the SetInputControlsHighlight sub in Helpers.vb does not restore original CssClass in the onblur event.

Replace this line:
Code:
wctl.Attributes.Add("onblur", "this.className = '';")
With this code:
Code:
wctl.Attributes.Add("onblur", String.Format("this.className = '{0}';", wctl.CssClass)) 'FIX: restores control's original style



The Following User Says Thank You to Scott663 For This Useful Post:
RexSr (February 21st, 2010)
 
Old February 6th, 2008, 05:18 PM
Authorized User
 
Join Date: Jan 2007
Posts: 72
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Thanks for the reply. In fact, your fix, fixed a problem I had after I resolved my original problem.

My problem was that my skin file settings (background color, border color etc.) seemed to override any style that this method tried to add.

I overcame this by changing my textbox properties in the skin file to:

<asp:TextBox runat="server" Font-Size="9px" CssClass="textbox"/>

then putting my styles in a css class as below:


.highlight {
    background:#f3f4f3;
    border-color: #5dcf3f;
    border-width: 1px;
    border-style:solid;
}

.textbox /*to enable highlighting skin file points to this class*/
{
    background:#f3f4f3;
    border-color:#e7e7e6;
    border-width:1px;
    border-style:solid;
}

and also adding your fix above for the helpers file so that on lost focus the controls revert back to their original style.

I now get my simple "Apple Stylee" textboxes with a thin lime green border when you highlight them.

Many thanks,

Retro






Similar Threads
Thread Thread Starter Forum Replies Last Post
Highlight text using form radio aspless Javascript 9 June 25th, 2008 03:50 AM
Count in combo box(display results in text box) mboyisis Access 4 April 4th, 2008 07:08 AM
How do I highlight a split function text? gilgalbiblewheel Classic ASP Basics 4 January 26th, 2006 04:25 PM
Select or Highlight Text ~Bean~ General .NET 0 November 9th, 2005 12:31 PM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.