For simplicity, I am going to reduce the problem to its simplest of components:
+ script.do (action): This action class (struts) will look for the parameter "action" = ("init", "progress", "rollback") to determine which form to display. It does the following:
1. Inputs the form data 2. Validates the data 3. Does "something" with the data 4. Determines which form to display next 5. Outputs the next form
THE PROBLEM - - - - - - - - - - - - - - - - - - - I am having trouble submitting the dynamic form without any knowledge of what form elements exist inside the form. Is there a way to dynamically cycle through all of the form-elements given only the ID of the form?
For example - it would be really great if there was a method with a signature like this:
So that if I do this:
The variable theURL will be "script.do?param1=val1¶m2=val2...."
Note: the dynamic form "myForm" would be created by script.do, and would contain any number of form elements. I'd really just want the URL which would show up in the Address Bar if i were to click "submit" on the form and perform an overall page "GET" action on the form. But since I don't want to refresh the page - that is not an option.
I have code snippets for my "first stab" at this problem - but it doesn't work. I can put the code as a reply to this post (if necessary). [ April 24, 2007: Message edited by: Scott McGhee ]