dcsimg
Multiple forms on one page, but how to set the error on the one that was submitted ?
1 posts in topic
Flat View  Flat View
TOPIC ACTIONS:
 

Posted By:   Sam_Sam
Posted On:   Wednesday, January 1, 2003 11:46 AM

Lets say I have a basket on a shopping site, and the basket has various lines. EG, ProductX £30 Qty: [1] [UPDATE] ProductY £20 Qty: [2] [UPDATE] ProductZ £10 Qty: [3] [UPDATE] Now each of those lines is a form with the update being the submit button and the qty being a text input. The form is sent to the Action, and validated to make sure the qty is valid. Now, lets say the user enters 'A' as the qty, the form bean will fail the validate and return to the JSP, but how do I know which one of the basket line forms to set the error against? Ie, if the user submits the second form then I want the error to appear in the second form.    More>>

Lets say I have a basket on a shopping site, and the basket has various lines.




EG,




ProductX £30 Qty: [1] [UPDATE]

ProductY £20 Qty: [2] [UPDATE]

ProductZ £10 Qty: [3] [UPDATE]





Now each of those lines is a form with the update being the submit button and the qty being a text input. The form is sent to the Action, and validated to make sure the qty is valid. Now, lets say the user enters 'A' as the qty, the form bean will fail the validate and return to the JSP, but how do I know which one of the basket line forms to set the error against? Ie, if the user submits the second form then I want the error to appear in the second form.




Hope that makes sense.




Thank you.

   <<Less

Re: Multiple forms on one page, but how to set the error on the one that was submitted ?

Posted By:   Christopher_Koenigsberg  
Posted On:   Thursday, January 2, 2003 11:10 AM

It works better if you keep it down to only one form per page.

About | Sitemap | Contact