You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@struts.apache.org by di...@jpmorgan.com on 2006/02/21 22:59:34 UTC

How to retain form data when disabling input in html:text

I have <html:text property="bucketName" disabled="true"  size="40"/>
I populate html:text with data from DB.
I want to disable input for this property, but
when I get form data back in Action form bean does not have data for this 
property "bucketName"

How do i retain data after disabling input in html:text.

Thanks.

This communication is for informational purposes only. It is not intended
as an offer or solicitation for the purchase or sale of any financial
instrument or as an official confirmation of any transaction. All market prices,
data and other information are not warranted as to completeness or accuracy and
are subject to change without notice. Any comments or statements made herein 
do not necessarily reflect those of JPMorgan Chase & Co., its subsidiaries 
and affiliates


Re: How to retain form data when disabling input in html:text

Posted by Craig McClanahan <cr...@apache.org>.
On 2/21/06, digant.k.joshi@jpmorgan.com <di...@jpmorgan.com> wrote:
>
> I have <html:text property="bucketName" disabled="true"  size="40"/>
> I populate html:text with data from DB.
> I want to disable input for this property, but
> when I get form data back in Action form bean does not have data for this
> property "bucketName"
>
> How do i retain data after disabling input in html:text.


Short answer ... you cannot.  By defintion in HTML, disabled fields are not
sent to the server, so the server has no opportunity to keep them for you.
On the other hand, if you make the field read only instead of disabled, the
value *will* be sent to the server ... but the user will not be able to edit
it.

Thanks.


Craig


This communication is for informational purposes only. It is not intended
> as an offer or solicitation for the purchase or sale of any financial
> instrument or as an official confirmation of any transaction. All market
> prices,
> data and other information are not warranted as to completeness or
> accuracy and
> are subject to change without notice. Any comments or statements made
> herein
> do not necessarily reflect those of JPMorgan Chase & Co., its subsidiaries
> and affiliates
>
>
>

Re: How to retain form data when disabling input in html:text

Posted by Michael Jouravlev <jm...@gmail.com>.
On 2/21/06, digant.k.joshi@jpmorgan.com <di...@jpmorgan.com> wrote:
> I have <html:text property="bucketName" disabled="true"  size="40"/>
> I populate html:text with data from DB.
> I want to disable input for this property, but
> when I get form data back in Action form bean does not have data for this
> property "bucketName"
>
> How do i retain data after disabling input in html:text.

Use session-scoped form or reload this value each time from the database.

Michael.

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