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

html:file using an image button

Is there a way to hide the standard browse button and use an image for the 
button instead?



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


Re: html:file using an image button

Posted by Ovidiu EFTIMIE <eo...@gmail.com>.
I'm using html:file and it works just fine . In my previous reply I
made a copy&paste from the generated html.
The most important lines are these 2  
document.forms[0].btnFichier.click();
document.forms[0].nomFichier.value=document.form["frmFichier"].btnFichier.value;





On Tue, 10 Aug 2004 12:21:44 -0700, Michael McGrady
<mi...@michaelmcgrady.com> wrote:
> At 10:14 AM 8/10/2004, you wrote:
> >Use something like this
> ><script>
> >function getNomFichier(){
> >document.forms[0].btnFichier.click();
> >document.forms[0].nomFichier.value=document.form["frmFichier"].btnFichier.value;
> >}
> ></script>
> >
> ><input type="text" name="nomFichier" disabled><img
> >src="../images/loupe.gif" onclick="getNomFichier();">
> ><div style="display:none">
> >     <input type="file" name="btnFichier">
> ></div>
> 
> 
> Will this work with <input type='file'>?
> 
> 
> 
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
> For additional commands, e-mail: user-help@struts.apache.org
> 
>

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


Re: html:file using an image button

Posted by Michael McGrady <mi...@michaelmcgrady.com>.
At 10:14 AM 8/10/2004, you wrote:
>Use something like this
><script>
>function getNomFichier(){
>document.forms[0].btnFichier.click();
>document.forms[0].nomFichier.value=document.form["frmFichier"].btnFichier.value;
>}
></script>
>
><input type="text" name="nomFichier" disabled><img
>src="../images/loupe.gif" onclick="getNomFichier();">
><div style="display:none">
>     <input type="file" name="btnFichier">
></div>


Will this work with <input type='file'>?




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


Re: html:file using an image button

Posted by Ovidiu EFTIMIE <eo...@gmail.com>.
Use something like this
<script>
function getNomFichier(){
document.forms[0].btnFichier.click();
document.forms[0].nomFichier.value=document.form["frmFichier"].btnFichier.value;
}
</script>

<input type="text" name="nomFichier" disabled><img
src="../images/loupe.gif" onclick="getNomFichier();">
<div style="display:none">
    <input type="file" name="btnFichier">
</div>

Ovidiu









On Tue, 10 Aug 2004 08:27:49 -0700, Michael McGrady
<mi...@michaelmcgrady.com> wrote:
> At 07:41 AM 8/10/2004, you wrote:
> >Michael McGrady wrote:
> >
> >>Is there a way to hide the standard browse button and use an image for
> >>the button instead?
> >
> >Michael,
> >
> >I don't believe this is part of the HTML spec, so in short, no. Every
> >browser uses a different button for browsing. I don't believe that even
> >CSS can control this.
> 
> There is a way, Brice.  There are many, actually, as it turns out.
> 
> 
> 
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
> For additional commands, e-mail: user-help@struts.apache.org
> 
>

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


Re: html:file using an image button

Posted by Michael McGrady <mi...@michaelmcgrady.com>.
At 07:41 AM 8/10/2004, you wrote:
>Michael McGrady wrote:
>
>>Is there a way to hide the standard browse button and use an image for 
>>the button instead?
>
>Michael,
>
>I don't believe this is part of the HTML spec, so in short, no. Every 
>browser uses a different button for browsing. I don't believe that even 
>CSS can control this.

There is a way, Brice.  There are many, actually, as it turns out.



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


Re: html:file using an image button

Posted by "Ruth, Brice" <br...@fiskars.com>.
Michael McGrady wrote:

> Is there a way to hide the standard browse button and use an image for 
> the button instead?

Michael,

I don't believe this is part of the HTML spec, so in short, no. Every 
browser uses a different button for browsing. I don't believe that even 
CSS can control this.

-- 
Brice Ruth, Sr. IT Analyst
Fiskars Brands Inc
http://www.fiskarsbrands.com/


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