I have a form which if the user contains no serial # a text box needs to appear. Which I have done now. My problem is that I am trying to validate the field. However it does not seem to get to the validation method which I have defined. Can this be done with org.apache.struts.action.DynaActionForm? Im using <html:multibox in my jsp and that is why I am using DynaActionForm.
thank you all for your time
In my jsp I have the following
I have the following in the struts-config
In the validator-rules.xml I have
[ February 11, 2005: Message edited by: john mattucci ]
Yes to all questions. The page can either have a serial number text box if the user does not have a serial number or not if he does have one. So I cant use required since the field might not appear at times. But for now I even changed the field to required and it still does not validate
Joined: Jan 10, 2005
Ah, I might see part of the problem.
In your form, you have two attributes named newtones and oldtones.
Then in your validator.xml you are looking for a attribute named serialnumber.
All these values have to be named the same. If they arn't then you will run into problems. You should at least add the attribute serialnumber to your form. FYI, You don't have to have all the attributes of your form in the validator.xml.
No i dont have all my fields in the validator.xml only serial number. But serial number is only present some of the time in other words i cant mark it required. I created my own method in the validator-rules.xml. The problem im facing now is that this method is not even being called and even I mark the field as required in the validator.xml no error is shown it always goes directly to the action.
This is pertaining to another posting you did earlier. I am getting the same error. I tried your approach of rebuilding the project to remove any stale files. But that did not work. Did you do anything else??
Can you please reply to my post [b]IllegalArgumentException: argument type mismatch[b] posted on February 10, 2005 02:24 PM.
Any help appreciated.
p.s. I tried to email you, but the mail bounced back.
subject: Is it possible to use DynaActionForm for the following?