Hello everybody!
I would like to submit form data to two different actions with different validation:
e.g. input data: liters
After pushing button "Submit" it is checked if liters has been entered and if it is a number
On the same page there is another button "Reject" that only checks if liters has been entered.
If the validation was not successful the entered data should be shown again in the form.
I created two actions "Submit.do" and "Reject.do" and assigned them form beans "Submit" and "Reject" in struts-config.xml. In validation.xml I defined the different validations for the form beans.
Each button calls a javascript that changes the form action to "Submit.do" or "Reject.do"
The problem now is that when I press "Reject" and validation is not successful the entered value for liters is not shown in the form. I found out that this is because in the JSP I defined <form action="Submit.do">. When I change it to "Reject.do" the input is not shown after pushing "Save".
Is there another way to achieve the wanted result? Any help would be appreciated.
Kind regards,
Stefan
I would like to submit form data to two different actions with different validation:
e.g. input data: liters
After pushing button "Submit" it is checked if liters has been entered and if it is a number
On the same page there is another button "Reject" that only checks if liters has been entered.
If the validation was not successful the entered data should be shown again in the form.
I created two actions "Submit.do" and "Reject.do" and assigned them form beans "Submit" and "Reject" in struts-config.xml. In validation.xml I defined the different validations for the form beans.
Each button calls a javascript that changes the form action to "Submit.do" or "Reject.do"
The problem now is that when I press "Reject" and validation is not successful the entered value for liters is not shown in the form. I found out that this is because in the JSP I defined <form action="Submit.do">. When I change it to "Reject.do" the input is not shown after pushing "Save".
Is there another way to achieve the wanted result? Any help would be appreciated.
Kind regards,
Stefan