struts-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Laurie Harper <>
Subject Re: Validation framework for Dynamically added HTML elements?
Date Thu, 14 Sep 2006 20:04:56 GMT
You can achieve what you want more simply; no need to start using Ajax 
just for expanding an input form :-)

What you need to do is to generate additional rows that use the correct 
naming conventions for the parameter names. Start by getting the form 
working for some fixed number of input rows, backed by indexed 
properties in your form bean. Then just modify your Javascript as 
necessary so that the dynamically generated inputs look the same as the 
ones that were served by Struts.


Patil, Sheetal wrote:
> U can create array and create field as per reqiuirment,but this has
> limit and here problem is for "arrayindexoutofboundexception" after
> limit exceeds.
> Elsewise u can use ajax, put ur form in session and send requeset to an
> action which will increase the size of array and again put into the
> session. Then u can dynamically create as many fields u want...
> -----Original Message-----
> From: Mallik [] 
> Sent: Thursday, September 14, 2006 11:40 AM
> To:
> Subject: Validation framework for Dynamically added HTML elements?
> Hi Friends
> i have one form where user enter his family details for this i create on
> row of fields (like name,relationtype,occupation) if user want to add
> one more relation, he click on addmore button then i provied one more
> row and user need more, click on addmore and i create another row this
> way my form will get fields dynamically using javascript
> createElement() method,
> now i want to add validation framework for this form how to manage in
> struts-config.xml ( for each form field we specify <form-property
> name="" type=""/> or is there any alternative solution for this problem
> in struts framework please let me know urs Mallik
> --
> View this message in context:
> ements--tf2269760.html#a6300004
> Sent from the Struts - User forum at
> ---------------------------------------------------------------------
> To unsubscribe, e-mail:
> For additional commands, e-mail:

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

View raw message