[thelist] IE adding padding to submit buttons

James O'Donnell jimmyropes at gmail.com
Tue Jul 28 19:05:42 CDT 2009


Use an onclick event on a regular button (not a submit button).

The javascript would just change the action of the form and then submit the
form.  If the method on the form is post then post it will.

-----Original Message-----
From: thelist-bounces at lists.evolt.org
[mailto:thelist-bounces at lists.evolt.org] On Behalf Of Bill Moseley
Sent: Tuesday, 28 July, 2009 19:59
To: thelist at lists.evolt.org
Subject: Re: [thelist] IE adding padding to submit buttons

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
-- 

* * Please support the community that supports you.  * *
http://evolt.org/help_support_evolt/

For unsubscribe and other options, including the Tip Harvester 
and archives of thelist go to: http://lists.evolt.org 
Workers of the Web, evolt ! 

No virus found in this incoming message.
Checked by AVG - www.avg.com 
Version: 8.5.392 / Virus Database: 270.13.31/2264 - Release Date: 07/28/09
17:58:00




More information about the thelist mailing list