textbox sizing problems with firefox browser

Discussion in 'HTML / PHP / JavaScript / CSS' started by Rookie, Mar 19, 2006.

  1. Does anyone know why the standard 'width='300px' won't work in a <asp:textbox></asp:textbox> tag?

    What is the correct way to change the size of a textbox to display properly in firefox?

    Thanks in Advnace!
     
  2. <asp:TextBox ID="txtMiddleName" CssClass="textbox" TabIndex="7" runat="server" Width="25px" MaxLength="2" value = "M" onfocus="if(this.value=='M')this.value=''; doHighlightsmall(this,'on')" onBlur="doHighlightsmall(this,'off');"></asp:TextBox>

    The class "textbox" does not contain any height or width constraints
     
  3. Sorry I left off the url http://www.undersound2.com/dev_createaccount.aspx.

    I sovled this isssue temporarily by including the width in the css class. This means I have to create a bounce of classes for each size text box which is kind of a pain. If you can help that would be great.

    Thanks, Joel
     
  4. Thank you Joel, I feel like you guys know everything!
     
  5. Ahh. I think this was a bug in asp.net 1.x. This works properly in asp.net 2.0. If you view source in IE and firefox, you'll notice the style="width:123px;" is being left out when the server renders the page for fire fox.

    If you can, switch to asp.net 2.0 or manually add the width style in...

    <asp:textbox runat="server" id="mybox" style="width:123px;" />


    Joel Thoms
    DiscountASP.NET
    http://www.DiscountASP.NET
     
  6. It does on my projects. Please provide the entire code you are using for <asp:textbox /> and a url to an example of your problem.



    Joel Thoms
    DiscountASP.NET
    http://www.DiscountASP.NET
     

Share This Page