struts-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Robert Nocera" <>
Subject RE: dynamic javascript forms
Date Mon, 15 Mar 2004 20:45:56 GMT
I'm pretty sure you can do it if the text inputs are set up in the form as
an Array of Strings and if you create your input tags to match what struts
would expect from an array.  If you do that, you can have your javascript
create the fields dynamically as you said.

It sounds like you tried this and it didn't work for you, but I would think
it's probably just because you either didn't use an array setting up the
action form, or you didn't create html input tags that matched what struts
would have created if you used html:input.


-----Original Message-----
From: mike barretta [] 
Sent: Monday, March 15, 2004 2:35 PM
Subject: dynamic javascript forms

thanks in advance for any help...

i have a form where i let the user choose how many text input fields 
they want and then via javascript, the inputs are displayed.

ex: user has a <select> box to make a choice of 1-10.  after selection 
is made, the onChange event will fire and write however many text inputs 
on the screen using the innerHTML property.

my problem is that since javascript changes the screen at runtime, i 
can't use <html:input> to capture the text from the form because it 
isn't being interpreted by struts.  if the javascript uses the standard 
<input type="text"> tags, it seems like my actionform doesn't get 
populated with the data.

so, anyway to do this without having to submit the form after the user 
selects how many inputs they want?

To unsubscribe, e-mail:
For additional commands, e-mail:

To unsubscribe, e-mail:
For additional commands, e-mail:

View raw message