Laurie,

As you can see above in my sample code, I am already setting the
type="button" as you have suggested and I have also verified that the html
getting rendered is a <button..> and not <input type="button"..>.

Can you try it for yourself as see if you can get it to work?

Maybe I will have to write up a bug report for this.

Thanks,
Bill



Laurie Harper wrote:
> 
> billgloff wrote:
>> Using the button element in normal HTML you can do the following:
>> 
>> <button type="submit">
>>    &lt;img src="/images/icons/tick.png" alt=""/&gt;  Save
>> </button> 
>> 
>> which gives you an icon along with the label on the button itself.
>> 
>> When I attempt to try the same thing using S2 tags e.g.
>> 
>> <s:submit theme="simple" type="button">                                      
>>         
>>    &lt;img src="/images/icons/tick.png" alt=""/&gt;  Save                    
>>                                                                 
>> </s:submit>
>> 
>> is gets rendered in the following way:
>> 
>> &lt;img src="/images/icons/tick.png" alt=""/&gt;Save                         
>>                                                 
>> <button type="submit" id="someForm_0" value="Submit">Submit</button>
>> 
>> I also have tried using the following inside the body with no luck.
>> 
>> <s:param name="body">
>>   &lt;img src="/images/icons/tick.png" alt=""/&gt;  Save
>> </s:param> 
>> 
>> How can I add an icon to my button?
>> I do not understand why any text in the tag body gets pushed out to the
>> front of the tag. 
>> 
>> Thanks for any help on this!
> 
> s:submit is rendering an <input type="submit"..., not a <button... so 
> the behaviour you're seeing is expected. If you want a button element, 
> set <s:submit>'s 'type' attribute to 'button', as listed in the tag docs 
> [1].
> 
> L.
> 
> [1] http://struts.apache.org/2.x/docs/submit.html
> 
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
> 
> 
> 

-- 
View this message in context: 
http://www.nabble.com/S2-Cannot-get-Submit-button-body-to-render-as-label...-tf4517330.html#a12902359
Sent from the Struts - User mailing list archive at Nabble.com.


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

Reply via email to