Win a copy of Functional Reactive Programming this week in the Other Languages forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Form Validation and Delete using struts

 
rahul V kumar
Ranch Hand
Posts: 82
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I have a web page which has few form fields.
These form fields are populated with some data based on the user logon on.
i have two buttons. Button 1 is "Save"
and Button 2 is "Delete"
Both these buttons call the same ActionServlet.
If the user clicks "Save", I have to verify that all the fields are entered and then I have to save the data to persistent store. If the user selects "Delete" then I shouldn't be checking the data in the form fields and should delete the data from the persistent store.
I know the validation could be performed using validate method in ActionForm class.
Question 1) When the user hits the "Delete" button will the validate method be called.
If so how can i avoid calling the validate method.
Thanks in advance
 
rahul V kumar
Ranch Hand
Posts: 82
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I found a way out for this one.
I was setting the form action based on the button selection
and it helped me resolve this issue
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic