PDA

View Full Version : Adjusting the Width of the Control after Aplying a Style?


mdmandar
03-06-2003, 06:04 AM
I have a Text Control.
Its width is set to 100 %

I have a CSS Class applied to it.

I Change the CSS Style when the Control gets the Focus and and when it loses the focus.

(To highlight the active control i am changing style.)

Now When i enter data into control (there is no limit that user can enter in the Textbox) if extends the width of the control, the width of the control increases when i loses the focus

I am using the onblur event to apply the style to it.

But this is the same style i have which applied before, though i change it onfoucs event to other style

Can some one please explain me what exactly is happening there ?

I have also attahced a word doc which have images, to give you exact idea of wha exactly is happening



Thanks in advnace

meow
03-06-2003, 06:12 AM
Better take that one more time and slowly. :confused:

mdmandar
03-06-2003, 07:01 AM
Ok I Will Try Again :)

I Have a Control with the Following Properties

<asp:TextBox ID="txtBranchName" Width="100%" onBlur="this.className='select'" onfocus="this.className='FocusField'" MaxLength="100" Runat="server" CssClass="select" onKeyPress="validateAlphaNum();"></asp:TextBox>

I Want to Highliht the Control when it gets the focus, hence i have :- onfocus="this.className='FocusField'"

Also i have to set control to original position once i loose the focus. hence onBlur="this.className='select'"

but......when i go enter the data into the text say 250 Characters.
and loose the focus height of the control increases.

le tme know i its still not lear