You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@struts.apache.org by Laurie Harper <la...@holoweb.net> on 2005/10/01 02:22:39 UTC

Re: submit buttons - how to put them label from resource

Wendy Smoak wrote:
> From: "Borislav Sabev" <b....@eventsoft.de>
>> I'd like to set a label of submit buttons getting it from property 
>> file. But seems that this is not possible.
>> One other problem I see is that value attribute has two purposes: to 
>> set the label, and on submit to provide value for the request 
>> parameter. Is there any way they to be different?
> 
> No.  I get around it with client-side scripting.  (It's an intranet app, 
> so I can guarantee JavaScript is enabled.)
> 
> <html-el:submit property="submit" onclick="setUserAction('Add 
> Prospect');" styleClass="addButton" titleKey="button.add.prospect" 
> value="Add"/>
> 
> function setUserAction(target) {document.forms[0].userAction.value=target;}

Another approach, which avoids the need for client-side scripting, is to 
use a different request parameter for each submit button and test for 
the presence of the parameter, ignoring its value.

L.


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