-
Oct 9th, 2006, 10:08 PM
#1
Binding dynamically created fields
Hello,
I have a html file which dynamically generate the fields on clicking the Add button.
<body>
<!-- <button onclick="window.location='personEditMA.htm'">test the multiaction controller</button>-->
<FORM method="post" action="personEditMA.htm"> <!-- personEditMA.htm -->
<INPUT name ="method" type="hidden" value ="handlePersonList">
<TABLE id="personsTab" border="1" >
<TR valign="top"><th>Sr. No.</th><th>ID</th><th>First Name</th><th>Middle Name</th><th>Last Name</th></TR>
</TABLE>
<button onclick="javascript:addPerson();">Add Person</button> <INPUT type="submit" value="Save Persons">
</FORM>
<CENTER><a href="/index.html">Go to HOME </a> </CENTER>
<SCRIPT language="Javascript">
var lastRowIndex = -1 ;
//alert( "Number of rows : " + (lastRowIndex + 1));
function addPerson(){
//Code for dynamically generating the text fields for Sr. No., ID, First Name,Middle Name and Last Name
}
</SCRIPT>
</body>
when a user clicks on the addPerson button a new row of fields will be created.
I have PersonVO class.
public class PersonVO {
private String id;
private String firstName;
private String middleName;
private String lastName;
}
with getters and setters.
My problem is how to get the values of fields which are entered by the user.
User can enter information for 1 ,2 or n number of persons. I want all the form data in my controller.
Or Is there any way by which I can bind it with my domain object.
any help will appreciated
thankx in advance.
Regards
DEV
BTC
-
Sep 6th, 2012, 04:41 AM
#2
Hello!
I´m having the same problem with my application.
Have you found any solution?
I would be very glad if you coukd help me.
Thanks!
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules