Chris;
 
Thanks for the reply - I took the session-based form approach, which
worked fine.
 
Another issue - I wish to allow users to modify content to records
saved to the database, by loading up the same (or identical ) form 
referenced below with a saved record and allow for modifications. I do
this in an action which retrieves the record from the datastore, saving
the record in a request attribute, and displaying the values in the form
by setting the value attribute of the <html:input>  tags as follows:
 
<html:text property="name" value="${modrecord.name}"/>
 
 
The data displays correctly, but when making modifications and passing
the result thru validation, when validation fails for any reason  the
data in the input fields disappear. 
 
Is there a (better) way to present data in a form for modification,
allow updates and to have validation work without clearing the input
fields?
 
Thanks and regards,
 
--Chris
 


>>> [EMAIL PROTECTED] 3/14/2007 12:24:03 PM >>>

-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Chris,

Christopher Becker wrote:
> A simple javascript:back() approach is not feasible (nor desirable)
> [...]

[snip]

> Could someone provide insight on the best approach to allow for
> re-display (and re-validation) of form content? Any guidance would
be
> appreciated... thanks!

You have three obvious options. I'm sure there are others.

1. Use a session-based form, and then just use a link back to the form
display. (Remember to remove the form from the session when you're
done,
just to keep things tidy).

2. Create a link back to your form display and put every form field
value into the URL parameters. Something like:

<a
href="/myform.do?firstName=Chris&lastName=Becker&gender=M&...">edit</a>


3. Use a form to POST back to the original for display:

<form action="/myform.do">
<input type="hidden" name="firstName" value="Chris" />
<input type="hidden" name="LastName" value="Becker" />
<input type="hidden" name="gender" value="M" />
...
<input type="submit" value="Edit" />
</form>

Of course, 2 and 3 Are really the same technique done in different
ways.
If you have a lot of form elements, you might want to use the
form-based
solution to avoid URLs that are potentially too long for the server
(or
just ugly to you).

Hope that helps,
- -chris
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.7 (MingW32)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org

iD8DBQFF+CGi9CaO5/Lv0PARAkDoAKCnFQhqNC5IcYK2tuSh1QsK0zPTBwCgkHyk
RfWnYu41HcZaLVaimkPpnkI=
=62SA
-----END PGP SIGNATURE-----

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


Reply via email to