Firefox extends input type

Discussion in 'HTML & Website Design' started by aras, May 17, 2007.

  1. #1
    Hello

    I use a custom validator in my forms, and if there is an error in the input type i load a background image to the input box to indicate there is a problem there.

    document.getElementById(what).style.backgroundImage = "url('images/error.png')";
    document.getElementById(what).style.backgroundRepeat = "no-repeat";
    document.getElementById(what).style.backgroundPosition = "left top";
    document.getElementById(what).style.paddingLeft = "15px";

    This works good in IE, but in Firefox, when i load error.png into the box, it extends the length of the box by the size of the image. No problem in functioning but it makes a bad look. When the error is removed and backgroundImage is cleared it turns back to normal length.
     
    aras, May 17, 2007 IP
  2. Felu

    Felu Peon

    Messages:
    1,680
    Likes Received:
    124
    Best Answers:
    0
    Trophy Points:
    0
    #2
    Try to define the width using the width style tag.
     
    Felu, May 17, 2007 IP