That did the trick. Many thanks!
-----Original Message----- From: John Moore [mailto:[EMAIL PROTECTED] Sent: 13 May 2004 17:58 To: Struts Users Mailing List Subject: Re: Newbie question: How to implement conditional validation in an ActionForm? Adam Lipscombe wrote: > >Is there any way to recognise that the cancel button has been pressed >wothin the validate method? Or should I move the validation to the >Action classes? > > > Well yes, it doesn't really matter where you do it, the same thing applies. I presume your Cancel button is a submit button. You can check for whether it has been clicked before doing any testing of page number, thus: String submitText=httpServletRequest.getParameter("submit"); if(submitText!=null && submitText.trim().equalsIgnoreCase("Cancel")){ //do whatever HTH, John -- ============================================== John Moore - Norwich, UK - [EMAIL PROTECTED] ============================================== --------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] --------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]