[thelist] IE adding padding to submit buttons

Bill Moseley moseley at hank.org
Tue Jul 28 18:59:16 CDT 2009

On Tue, Jul 28, 2009 at 4:46 PM, James O'Donnell <jimmyropes at gmail.com>wrote:

> This will explain why you are seeing different results based on if the
> browser follows the W3C box model or not.
> http://en.wikipedia.org/wiki/Internet_Explorer_box_model_bug

That explains why the number of characters inside the <input>'s value
determines how much padding there is?

This is the element in my example:

 <input type="submit" value="Test One with some text" name="test1"/>

> You can get around this by putting the text in a span tag and the image in
> am img tag.  Wrap both in an anchor tag and it should render correctly on
> all browsers.
> Try something like this.
> <a href=""><span>Some text</span><img src="YourImageURI" /></a>
> In the href put "javascript:YourSubmitScript();"
> Or
> <div onclick="YourSubmitScript();"><span>Some text</span><img
> src="YourImageURI" /></div>

Well, I'd probably attach an event instead of doing it that way.  But, the
original goal was to use a submit button so that Javascript was not
required.  We have a requirement that actions that change the database state
require a post.

Bill Moseley
moseley at hank.org

More information about the thelist mailing list