You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@struts.apache.org by Wendy Smoak <ja...@wendysmoak.com> on 2004/10/07 00:50:59 UTC
Value of hidden field from ApplicationResources.properties?
I have what must be the world's simplest form... it has a text field and a
button:
<html-el:form action="denRegister" >
<fmt:message key="label.associationId"/>: <br/>
<html-el:text property="associationId" size="15" />
<html-el:submit property="nextStep">
<fmt:message key="button.validate"/>
</html-el:submit>
</html-el:form>
It works great if the user clicks the button... not so great if he presses
enter, which submits the form without the value of nextStep coming through.
So I thought to put a hidden field in the form and just ignore the button
entirely. But I can't seem to get the value of the hidden field to come
from ApplicationResources.properties. I tried to do it like the submit
button, but <html-el:hidden> *must* be an empty tag. None of the possible
attributes seem to do it.
Am I missing something? Otherwise I have to hardcode it...
<html-el:hidden property="nextStep" value="Validate" />
--
Wendy Smoak
---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
For additional commands, e-mail: user-help@struts.apache.org
Re: Value of hidden field from ApplicationResources.properties?
Posted by Jeff Beal <jb...@webmedx.com>.
I'd just use <input type="hidden" name="nextStep" value="<fmt:message
key='button.validate'/>">.
Wendy Smoak wrote:
> I have what must be the world's simplest form... it has a text field and a
> button:
>
> <html-el:form action="denRegister" >
> <fmt:message key="label.associationId"/>: <br/>
> <html-el:text property="associationId" size="15" />
> <html-el:submit property="nextStep">
> <fmt:message key="button.validate"/>
> </html-el:submit>
> </html-el:form>
>
> It works great if the user clicks the button... not so great if he presses
> enter, which submits the form without the value of nextStep coming through.
>
> So I thought to put a hidden field in the form and just ignore the button
> entirely. But I can't seem to get the value of the hidden field to come
> from ApplicationResources.properties. I tried to do it like the submit
> button, but <html-el:hidden> *must* be an empty tag. None of the possible
> attributes seem to do it.
>
> Am I missing something? Otherwise I have to hardcode it...
> <html-el:hidden property="nextStep" value="Validate" />
>