I dealt with this with the following strategy:

On any page that uses at least one image submit button (even if there
are also normal submit buttons on the page), add a hidden form parameter
named "submitMethod" (the parameter normally set by the submit button).
Change all the submit buttons (not just the image ones) to use a
different parameter (it will be ignored).  Add a javascript function to
set the "submitMethod" parameter.  Set the "onclick" event on all the
submit buttons to call that function, sending the desired "submitMethod"
value.  Add comment chastising IE.

> -----Original Message-----
> From: Karr, David 
> Sent: Monday, December 20, 2004 4:18 PM
> To: Struts Users Mailing List
> Subject: Workaround for IE not sending "value" on input image tag?
> 
> 
> This isn't strictly a Struts question, but I may have to 
> manipulate the
> Struts tags to get around this problem.
> 
> I have some code that uses "html:image" to form an image 
> submit button.
> I don't care about the click coordinates, I just care about 
> the request
> parameter from the "name" parameter.
> 
> This code works fine when run in FireFox.
> 
> Unfortunately, I find that IE doesn't send a request 
> parameter named by
> the "name" attribute.  A quick google for this confirms this somewhat
> vaguely.
> 
> For instance, my "input" tag looks like the following.  When 
> I run this
> in FireFox, I get a request parameter named "submitMethod", with the
> value "abc".  In IE, I don't see a "submitMethod" request parameter.
> Both browsers produce the ".x" and ".y" parameters, which I don't care
> about.
> 
>       <input type="image" name="submitMethod"
>              src="/inputbug/images/delete.gif" value="abc">
> 
> Is there a standard way of getting around this problem?  Is there a
> better place to ask questions like this?
> 
> ___________________________________________________
> David M. Karr, Technical Specialist II
> TSG Data Delivery and Integration Services
> Enterprise Application Integration (EAI)
> 
> Washington Mutual
> 1201 Third Avenue, WMT0914, Seattle, WA 98101
> www.wamu.com
> 
> 206.490.7289 direct | 206.909.0664 mobile
> 206.490.2262 fax
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
> 
> 

---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to