I saw similar queries have been asked in other topics, But even after reading that I could not lend up with a proper solution. So I am posting it in new thread.
Here is what I want to do, I want to have a Add button in my JSP which on click generate a textbox. This completely depends on user how many times he clicks on the Add button.
I have successfully implemented the java script part, But I am not sure How can I retrieve the information in those textboxes in my Struts action.
I have tried giving dynamically generated textboxes same name. I defined an ArrayList with the same name and getter, setter methods with that name in my Form Bean. But it didn't work.
Could anybody please tell me :
1. What kind of name should I give to the dynamically added textboxes ?
2. What kind of field should I define in my Form Bean to retrieve the information ?
3. What should be my getter setter methods for that particular field ?
Thanks for replying.
I already read that link following that I made a skeleton which I am posting here
MY Java Script
My relevant Form part
In my Action I am using
Where form is instance of my Form Bean. But I am getting exception when I submit this form, I am new to struts I might have missed some details in that article, But I am kind of stuck. Please guide me where I am doing the mistake.
Vikas Ramnani wrote:Hi,
But I am getting exception when I submit this form, I am new to struts I might have missed some details in that article, But I am kind of stuck. Please guide me where I am doing the mistake.