You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@struts.apache.org by José Carlos Ortiz <jo...@gmail.com> on 2006/10/10 22:02:25 UTC

How to put an image into a without CSS

Hello,

Does anybody know how to put an image inside a <html:submit> tag. I can't
use the background-image css property because the image has transparent
fragments and I need this fragments to be the same color of the text (text
is white and the background is other color).

If I try to use an <html:img> inside the <html:submit> it doesn't work. Any
idea? any solution?

Thanks!

-- 
Saludos,
José Carlos Ortiz

Re: How to put an image into a without CSS

Posted by Chris Pratt <th...@gmail.com>.
Use the <html:image> tag, it renders an <input type="image"> which works
just like a <input type="submit"> except that it displays an image rather
than a button.
  (*Chris*)

On 10/10/06, José Carlos Ortiz <jo...@gmail.com> wrote:
>
> Hello,
>
> Does anybody know how to put an image inside a <html:submit> tag. I can't
> use the background-image css property because the image has transparent
> fragments and I need this fragments to be the same color of the text (text
> is white and the background is other color).
>
> If I try to use an <html:img> inside the <html:submit> it doesn't work.
> Any
> idea? any solution?
>
> Thanks!
>
> --
> Saludos,
> José Carlos Ortiz
>
>

Re: How to put an image into a without CSS

Posted by Chris Pratt <th...@gmail.com>.
HTML can't do what you want.  You can create an image that looks like a
button (of course it won't change to match what the OS buttons look like),
that includes an image on it.  With that image you can either use an
<html:link> with some javascript or an <html:image>, but you can't put an
image on a button in HTML.
  (*Chris*)

On 10/11/06, Antonio Petrelli <ap...@apache.org> wrote:
>
> José Carlos Ortiz ha scritto:
> > But, it generates a image that links to another page, and I need a
> button,
> > with that image inside, that links to another page.
> >
> >
>
> http://www.htmlcodetutorial.com/forms/_BUTTON.html
>
> I don't think that Struts tags support this element, so I think you need
> to use <html:rewrite> to rewrite action URL.
>
> HTH
> Antonio
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
> For additional commands, e-mail: user-help@struts.apache.org
>
>

Re: How to put an image into a without CSS

Posted by Antonio Petrelli <ap...@apache.org>.
José Carlos Ortiz ha scritto:
> But, it generates a image that links to another page, and I need a button,
> with that image inside, that links to another page.
>
>   

http://www.htmlcodetutorial.com/forms/_BUTTON.html

I don't think that Struts tags support this element, so I think you need 
to use <html:rewrite> to rewrite action URL.

HTH
Antonio

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


Re: How to put an image into a without CSS

Posted by Laurie Harper <la...@holoweb.net>.
If you want an HTML 'button' element, use the <html:button> tag. A good 
rule of thumb for this sort of problem is to figure out how to achieve 
what you want in HTML, then figure out what tags will give you the same 
result.

L.

José Carlos Ortiz wrote:
> Thanks Ashok, but I need a button. Your solution gives me a image that works
> as a button, but I need a button with that image inside, next to the button
> text. Something like:
> 
> <button>
>    V Accept
> </button>
> 
> Where 'V' is the image I want to display...
> 
> 
> MADISHETTY, ASHOK [AG-Contractor/8042] wrote:
>> Jose,
>>
>> Try following:
>>
>> Do not write <html:submit> tag. Instead write the following by modifying
>> the
>> src location. It is equalent to <input type="image"> of HTML.
>>
>> <html:image src="images\return.gif" value="submit" />
>>
>> Thanks
>> Ashok
>>
>> -----Original Message-----
>> From: José Carlos Ortiz [mailto:joseortiz@gmail.com] 
>> Sent: Wednesday, October 11, 2006 1:41 PM
>> To: user@struts.apache.org
>> Subject: RE: How to put an image into a <html:submit> without CSS
>>
>>
>> But, it generates a image that links to another page, and I need a button,
>> with that image inside, that links to another page.
>>
>>
>> Chetan Pandey wrote:
>>> Then use <html:link> and insert your image between the link opening and
>>> closing tags.
>>>
>>> Chetan
>>>
>>> -----Original Message-----
>>> From: José Carlos Ortiz [mailto:joseortiz@gmail.com] 
>>> Sent: Wednesday, October 11, 2006 3:54 PM
>>> To: user@struts.apache.org
>>> Subject: Re: How to put an image into a <html:submit> without CSS
>>>
>>>
>>>
>>> Laurie Harper wrote:
>>>> José Carlos Ortiz wrote:
>>>>> Hello,
>>>>>
>>>>> Does anybody know how to put an image inside a <html:submit> tag. I
>>>>> can't
>>>>> use the background-image css property because the image has transparent
>>>>> fragments and I need this fragments to be the same color of the text
>>>>> (text
>>>>> is white and the background is other color).
>>>> Err, I don't think there's any way to make transparent portions of an 
>>>> image render as foreground colour rather than background colour, how 
>>>> ever you get the image displayed.
>>>>
>>>>> If I try to use an <html:img> inside the <html:submit> it doesn't work..
>>>>> Any
>>>>> idea? any solution?
>>>> The <html:image> tag [1] may be what you're looking for.
>>>>
>>>> L.
>>>>
>>>> [1] http://struts.apache.org/1.3.5/struts-taglib/tlddoc/html/image.html
>>>>
>>>>
>>> I'm using this:
>>>
>>> <html:submit property="op" titleKey="boton.ayuda.eliminar"
>>> styleClass="botonesPantalla">
>>> 	<html:image src="/img/borrar.gif" />
>>> 	<bean:message key="boton.eliminar" />
>>> </html:submit>
>>>
>>> But,it doesn't work, it generates a button with value <input type=
>>>
>>> I do it in this way because I need a button with a image inside, not a
>>> image
>>> with submit function. Any idea about how i can do it?
>>>
>>>
>>>
>>>
>>> -- 
>>> View this message in context:
>>>
>> http://www.nabble.com/How-to-put-an-image-into-a-%3Chtml%3Asubmit%3E-without
>>> -CSS-tf2419142.html#a6751934
>>> Sent from the Struts - User mailing list archive at Nabble.com.
>>>
>>>
>>> ---------------------------------------------------------------------
>>> 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
>>>
>>>
>>>
>> -- 
>> View this message in context:
>> http://www.nabble.com/How-to-put-an-image-into-a-%3Chtml%3Asubmit%3E-without
>> -CSS-tf2419142.html#a6752149
>> Sent from the Struts - User mailing list archive at Nabble.com.
>>
>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
>> For additional commands, e-mail: user-help@struts.apache.org
>>
>>
>> ---------------------------------------------------------------------------------------------------------
>> This e-mail message may contain privileged and/or confidential
>> information, and is intended to be received only by persons entitled to
>> receive such information. If you have received this e-mail in error,
>> please notify the sender immediately. Please delete it and all attachments
>> from any servers, hard drives or any other media. Other use of this e-mail
>> by you is strictly prohibited.
>>
>>
>> All e-mails and attachments sent and received are subject to monitoring,
>> reading and archival by Monsanto. The recipient of this e-mail is solely
>> responsible for checking for the presence of "Viruses" or other "Malware"..
>> Monsanto accepts no liability for any damage caused by any such code
>> transmitted by or accompanying this e-mail or any attachment.
>> ---------------------------------------------------------------------------------------------------------
>>
>>
>> ---------------------------------------------------------------------
>> 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: How to put an image into a without CSS

Posted by José Carlos Ortiz <jo...@gmail.com>.
Thanks Ashok, but I need a button. Your solution gives me a image that works
as a button, but I need a button with that image inside, next to the button
text. Something like:

<button>
   V Accept
</button>

Where 'V' is the image I want to display...


MADISHETTY, ASHOK [AG-Contractor/8042] wrote:
> 
> Jose,
> 
> Try following:
> 
> Do not write <html:submit> tag. Instead write the following by modifying
> the
> src location. It is equalent to <input type="image"> of HTML.
> 
> <html:image src="images\return.gif" value="submit" />
> 
> Thanks
> Ashok
> 
> -----Original Message-----
> From: José Carlos Ortiz [mailto:joseortiz@gmail.com] 
> Sent: Wednesday, October 11, 2006 1:41 PM
> To: user@struts.apache.org
> Subject: RE: How to put an image into a <html:submit> without CSS
> 
> 
> But, it generates a image that links to another page, and I need a button,
> with that image inside, that links to another page.
> 
> 
> Chetan Pandey wrote:
>> 
>> Then use <html:link> and insert your image between the link opening and
>> closing tags.
>> 
>> Chetan
>> 
>> -----Original Message-----
>> From: José Carlos Ortiz [mailto:joseortiz@gmail.com] 
>> Sent: Wednesday, October 11, 2006 3:54 PM
>> To: user@struts.apache.org
>> Subject: Re: How to put an image into a <html:submit> without CSS
>> 
>> 
>> 
>> Laurie Harper wrote:
>>> 
>>> José Carlos Ortiz wrote:
>>>> Hello,
>>>> 
>>>> Does anybody know how to put an image inside a <html:submit> tag. I
>>>> can't
>>>> use the background-image css property because the image has transparent
>>>> fragments and I need this fragments to be the same color of the text
>>>> (text
>>>> is white and the background is other color).
>>> 
>>> Err, I don't think there's any way to make transparent portions of an 
>>> image render as foreground colour rather than background colour, how 
>>> ever you get the image displayed.
>>> 
>>>> If I try to use an <html:img> inside the <html:submit> it doesn't work.
>>>> Any
>>>> idea? any solution?
>>> 
>>> The <html:image> tag [1] may be what you're looking for.
>>> 
>>> L.
>>> 
>>> [1] http://struts.apache.org/1.3.5/struts-taglib/tlddoc/html/image.html
>>> 
>>> 
>> 
>> I'm using this:
>> 
>> <html:submit property="op" titleKey="boton.ayuda.eliminar"
>> styleClass="botonesPantalla">
>> 	<html:image src="/img/borrar.gif" />
>> 	<bean:message key="boton.eliminar" />
>> </html:submit>
>> 
>> But,it doesn't work, it generates a button with value <input type=
>> 
>> I do it in this way because I need a button with a image inside, not a
>> image
>> with submit function. Any idea about how i can do it?
>> 
>> 
>> 
>> 
>> -- 
>> View this message in context:
>>
> http://www.nabble.com/How-to-put-an-image-into-a-%3Chtml%3Asubmit%3E-without
>> -CSS-tf2419142.html#a6751934
>> Sent from the Struts - User mailing list archive at Nabble.com.
>> 
>> 
>> ---------------------------------------------------------------------
>> 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
>> 
>> 
>> 
> 
> -- 
> View this message in context:
> http://www.nabble.com/How-to-put-an-image-into-a-%3Chtml%3Asubmit%3E-without
> -CSS-tf2419142.html#a6752149
> Sent from the Struts - User mailing list archive at Nabble.com.
> 
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
> For additional commands, e-mail: user-help@struts.apache.org
> 
> 
> ---------------------------------------------------------------------------------------------------------
> This e-mail message may contain privileged and/or confidential
> information, and is intended to be received only by persons entitled to
> receive such information. If you have received this e-mail in error,
> please notify the sender immediately. Please delete it and all attachments
> from any servers, hard drives or any other media. Other use of this e-mail
> by you is strictly prohibited.
> 
> 
> All e-mails and attachments sent and received are subject to monitoring,
> reading and archival by Monsanto. The recipient of this e-mail is solely
> responsible for checking for the presence of "Viruses" or other "Malware".
> Monsanto accepts no liability for any damage caused by any such code
> transmitted by or accompanying this e-mail or any attachment.
> ---------------------------------------------------------------------------------------------------------
> 
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
> For additional commands, e-mail: user-help@struts.apache.org
> 
> 
> 

-- 
View this message in context: http://www.nabble.com/How-to-put-an-image-into-a-%3Chtml%3Asubmit%3E-without-CSS-tf2419142.html#a6752896
Sent from the Struts - User mailing list archive at Nabble.com.


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


RE: How to put an image into a without CSS

Posted by José Carlos Ortiz <jo...@gmail.com>.
But, it generates a image that links to another page, and I need a button,
with that image inside, that links to another page.


Chetan Pandey wrote:
> 
> Then use <html:link> and insert your image between the link opening and
> closing tags.
> 
> Chetan
> 
> -----Original Message-----
> From: José Carlos Ortiz [mailto:joseortiz@gmail.com] 
> Sent: Wednesday, October 11, 2006 3:54 PM
> To: user@struts.apache.org
> Subject: Re: How to put an image into a <html:submit> without CSS
> 
> 
> 
> Laurie Harper wrote:
>> 
>> José Carlos Ortiz wrote:
>>> Hello,
>>> 
>>> Does anybody know how to put an image inside a <html:submit> tag. I
>>> can't
>>> use the background-image css property because the image has transparent
>>> fragments and I need this fragments to be the same color of the text
>>> (text
>>> is white and the background is other color).
>> 
>> Err, I don't think there's any way to make transparent portions of an 
>> image render as foreground colour rather than background colour, how 
>> ever you get the image displayed.
>> 
>>> If I try to use an <html:img> inside the <html:submit> it doesn't work.
>>> Any
>>> idea? any solution?
>> 
>> The <html:image> tag [1] may be what you're looking for.
>> 
>> L.
>> 
>> [1] http://struts.apache.org/1.3.5/struts-taglib/tlddoc/html/image.html
>> 
>> 
> 
> I'm using this:
> 
> <html:submit property="op" titleKey="boton.ayuda.eliminar"
> styleClass="botonesPantalla">
> 	<html:image src="/img/borrar.gif" />
> 	<bean:message key="boton.eliminar" />
> </html:submit>
> 
> But,it doesn't work, it generates a button with value <input type=
> 
> I do it in this way because I need a button with a image inside, not a
> image
> with submit function. Any idea about how i can do it?
> 
> 
> 
> 
> -- 
> View this message in context:
> http://www.nabble.com/How-to-put-an-image-into-a-%3Chtml%3Asubmit%3E-without
> -CSS-tf2419142.html#a6751934
> Sent from the Struts - User mailing list archive at Nabble.com.
> 
> 
> ---------------------------------------------------------------------
> 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
> 
> 
> 

-- 
View this message in context: http://www.nabble.com/How-to-put-an-image-into-a-%3Chtml%3Asubmit%3E-without-CSS-tf2419142.html#a6752149
Sent from the Struts - User mailing list archive at Nabble.com.


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


RE: How to put an image into a without CSS

Posted by Chetan Pandey <cp...@bluesingapore.com>.
Then use <html:link> and insert your image between the link opening and
closing tags.

Chetan

-----Original Message-----
From: José Carlos Ortiz [mailto:joseortiz@gmail.com] 
Sent: Wednesday, October 11, 2006 3:54 PM
To: user@struts.apache.org
Subject: Re: How to put an image into a <html:submit> without CSS



Laurie Harper wrote:
> 
> José Carlos Ortiz wrote:
>> Hello,
>> 
>> Does anybody know how to put an image inside a <html:submit> tag. I can't
>> use the background-image css property because the image has transparent
>> fragments and I need this fragments to be the same color of the text
>> (text
>> is white and the background is other color).
> 
> Err, I don't think there's any way to make transparent portions of an 
> image render as foreground colour rather than background colour, how 
> ever you get the image displayed.
> 
>> If I try to use an <html:img> inside the <html:submit> it doesn't work.
>> Any
>> idea? any solution?
> 
> The <html:image> tag [1] may be what you're looking for.
> 
> L.
> 
> [1] http://struts.apache.org/1.3.5/struts-taglib/tlddoc/html/image.html
> 
> 

I'm using this:

<html:submit property="op" titleKey="boton.ayuda.eliminar"
styleClass="botonesPantalla">
	<html:image src="/img/borrar.gif" />
	<bean:message key="boton.eliminar" />
</html:submit>

But,it doesn't work, it generates a button with value <input type=

I do it in this way because I need a button with a image inside, not a image
with submit function. Any idea about how i can do it?




-- 
View this message in context:
http://www.nabble.com/How-to-put-an-image-into-a-%3Chtml%3Asubmit%3E-without
-CSS-tf2419142.html#a6751934
Sent from the Struts - User mailing list archive at Nabble.com.


---------------------------------------------------------------------
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: How to put an image into a without CSS

Posted by José Carlos Ortiz <jo...@gmail.com>.

Laurie Harper wrote:
> 
> José Carlos Ortiz wrote:
>> Hello,
>> 
>> Does anybody know how to put an image inside a <html:submit> tag. I can't
>> use the background-image css property because the image has transparent
>> fragments and I need this fragments to be the same color of the text
>> (text
>> is white and the background is other color).
> 
> Err, I don't think there's any way to make transparent portions of an 
> image render as foreground colour rather than background colour, how 
> ever you get the image displayed.
> 
>> If I try to use an <html:img> inside the <html:submit> it doesn't work.
>> Any
>> idea? any solution?
> 
> The <html:image> tag [1] may be what you're looking for.
> 
> L.
> 
> [1] http://struts.apache.org/1.3.5/struts-taglib/tlddoc/html/image.html
> 
> 

I'm using this:

<html:submit property="op" titleKey="boton.ayuda.eliminar"
styleClass="botonesPantalla">
	<html:image src="/img/borrar.gif" />
	<bean:message key="boton.eliminar" />
</html:submit>

But,it doesn't work, it generates a button with value <input type=

I do it in this way because I need a button with a image inside, not a image
with submit function. Any idea about how i can do it?




-- 
View this message in context: http://www.nabble.com/How-to-put-an-image-into-a-%3Chtml%3Asubmit%3E-without-CSS-tf2419142.html#a6751934
Sent from the Struts - User mailing list archive at Nabble.com.


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


Re: How to put an image into a without CSS

Posted by Laurie Harper <la...@holoweb.net>.
José Carlos Ortiz wrote:
> Hello,
> 
> Does anybody know how to put an image inside a <html:submit> tag. I can't
> use the background-image css property because the image has transparent
> fragments and I need this fragments to be the same color of the text (text
> is white and the background is other color).

Err, I don't think there's any way to make transparent portions of an 
image render as foreground colour rather than background colour, how 
ever you get the image displayed.

> If I try to use an <html:img> inside the <html:submit> it doesn't work. Any
> idea? any solution?

The <html:image> tag [1] may be what you're looking for.

L.

[1] http://struts.apache.org/1.3.5/struts-taglib/tlddoc/html/image.html


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


RE: How to put an image into a without CSS

Posted by Chetan Pandey <cp...@bluesingapore.com>.
Hey Jose:

You don’t need to Use <html:submit> tag or <html:img> tag. Use the following

<html:image page="/img/btn_submit.gif" alt="submit" /></td>

Just remember USE <html:image>, not <html:img>

Chetan



-----Original Message-----
From: José Carlos Ortiz [mailto:jose.ortiz@gmail.com] 
Sent: Wednesday, October 11, 2006 4:02 AM
To: user@struts.apache.org
Subject: How to put an image into a <html:submit> without CSS

Hello,

Does anybody know how to put an image inside a <html:submit> tag. I can't
use the background-image css property because the image has transparent
fragments and I need this fragments to be the same color of the text (text
is white and the background is other color).

If I try to use an <html:img> inside the <html:submit> it doesn't work. Any
idea? any solution?

Thanks!

-- 
Saludos,
José Carlos Ortiz




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