You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@struts.apache.org by Michael McGrady <mi...@michaelmcgrady.com> on 2004/08/10 15:28:00 UTC

mozilla problems

Code like

<form name="formPrincipal" method="post" action="/whatever" 
enctype='multipart/form-data'>
  <input type="file" name="PHOTO1" style="display:none;">
  <input type="text" name="file">
   <img
     align=middle
     name="Parcourir"
     src="../images/parcourir.gif"
     border="0"
     onClick="document.formPrincipal.PHOTO1.click(); 
document.formPrincipal.file.value=document.formPrincipal.PHOTO1.value;">
  <input type='button' value='Submit2' 
onclick='document.formPrincipal.submit();'>
</form>

works with Internet Explorer but not with other browsers.  Anyone know 
solutions for other browsers.  I assume that there is a struts workaround 
as well.



---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@struts.apache.org
For additional commands, e-mail: dev-help@struts.apache.org


Re: mozilla problems

Posted by Michael McGrady <mi...@michaelmcgrady.com>.
At 08:32 AM 8/10/2004, you wrote:
>I don't think this is a Struts related issue.
>
>Just don't use "document.formName" in your javascript if you want
>HTML working with other browsers than MSIE.
>
>If you need to handle onClick event, try <form id="myForm">
>and "document.getElementById['myForm']" in your onClick handler
>instead.
>
>Pavel


Thank you for your response, Pavel.

I should have made it clear that I am TRYING to make this a struts 
issue.  I am trying to build a generic image button solution for Struts, 
including "automagic" button creation.  I have done a bit with 
http://wiki.apache.org/struts/StrutsCatalogMultipleImageButtonsWithNoJavaScript 
but want to get a solution that makes a lot more sense than that.

This presents a challenge to the generic solution because it is client side 
and "less related".  Nonetheless, I have to address the issue.

I have tried the <form id> idea but have failed.  Do you have a code 
snippet you think will work?

Michael




---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@struts.apache.org
For additional commands, e-mail: dev-help@struts.apache.org


Re: mozilla problems

Posted by Pavel Kolesnikov <k...@les.cz>.
I don't think this is a Struts related issue.

Just don't use "document.formName" in your javascript if you want
HTML working with other browsers than MSIE.

If you need to handle onClick event, try <form id="myForm">
and "document.getElementById['myForm']" in your onClick handler
instead.

Pavel

On Tue, 10 Aug 2004, Michael McGrady wrote:

> Code like
> 
> <form name="formPrincipal" method="post" action="/whatever" 
> enctype='multipart/form-data'>
>   <input type="file" name="PHOTO1" style="display:none;">
>   <input type="text" name="file">
>    <img
>      align=middle
>      name="Parcourir"
>      src="../images/parcourir.gif"
>      border="0"
>      onClick="document.formPrincipal.PHOTO1.click(); 
> document.formPrincipal.file.value=document.formPrincipal.PHOTO1.value;">
>   <input type='button' value='Submit2' 
> onclick='document.formPrincipal.submit();'>
> </form>
> 
> works with Internet Explorer but not with other browsers.  Anyone know 
> solutions for other browsers.  I assume that there is a struts workaround 
> as well.
> 
> 
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: dev-unsubscribe@struts.apache.org
> For additional commands, e-mail: dev-help@struts.apache.org
> 

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@struts.apache.org
For additional commands, e-mail: dev-help@struts.apache.org