You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@struts.apache.org by "Park, Dongwon" <Do...@Nextel.com> on 2002/04/01 18:15:52 UTC

RE: [Q] Using html:image tag for submit button

Thanks, John.

I found when it is not working for me.

If we use the following one, it is working as submit button.
<html:image page="/images/btn_continue.gif"/>

When we need to pass some value, we need to add more like this.
<html:submit property="action" value="Next" onclick="this.action=Next"/>
When it submitted, it called setAction() method in Form class.

This is <html:image> version.
<html:image page="/images/btn_continue.gif" property="action" value="Next"
onclick="this.action=Next"/>
When it submitted, struts "called" getAction() method in Form class. 

It seems like a bug. I am using Struts 1.0.2 with Tiles.

Regards,

Dongwon Park


 
-----Original Message-----
From: John Kroubalkian [mailto:John@Kroubalkian.com]
Sent: Saturday, March 30, 2002 10:11 PM
To: Struts Users Mailing List
Subject: Re: [Q] Using html:image tag for submit button


Dongwon,

There are at least a couple of ways to do this in Struts.  Here are two:

Ex 1: To pull the image from a url relative to the base url
<html:form action="/someAction.do" method="POST">
  User Name: <html:text property="username" size="15" />
   <p>
  <html:image page="/images/submit_button.gif" />
</html:form>

Ex 1: To pull the image path a key
[my.submit.button=/myapp/images/submit_button.gif]in the
ApplicationResources.properties:
<html:form action="/someAction.do" method="POST">
  User Name: <html:text property="username" size="15" />
   <p>
  <html:image srcKey="my.submit.button" />
</html:form>

Regards,
John

----- Original Message -----
From: "Park, Dongwon" <Do...@Nextel.com>
To: "Struts Users Mailing List" <st...@jakarta.apache.org>
Sent: Friday, March 29, 2002 3:06 PM
Subject: [Q] Using html:image tag for submit button


> All,
>
> I am trying to use <html:image> for submit button but it is not working
for
> me.
> Anybody has some simple example or know better way to make submit button
> with image ?
>
> Dongwon Park
>
> --
> To unsubscribe, e-mail:
<ma...@jakarta.apache.org>
> For additional commands, e-mail:
<ma...@jakarta.apache.org>


--
To unsubscribe, e-mail:
<ma...@jakarta.apache.org>
For additional commands, e-mail:
<ma...@jakarta.apache.org>

--
To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>