Mon Cab wrote:
I have read the struts documentation and am trying
to
work out how I would display an error image next to
an
invalid form field.
Ramesh mentioned that <html:errors
property="custName"/> would display the error
message
associated with a particular field. Is there a (set
of) struts tag(s) that would test whether a form
field
were invalid? (Maybe a combination of html and logic
tags).
I would like to do this without implementing any
ActionForms. Ideally I would like to specify
DynaValidatorForms in the struts-config file, and
specify field validations for those forms in the
validation.xml file.
I am presuming that the struts framework would then
generate a DynaValidatorForm object after the html
form were submitted. I am also presuming that this
would automatically populate the <html:errors> so
that
I could print the errors in my page, and I could
print
individual errors using <html:errors
property="formfield">. (Is this correct ??)
More or less, yes.
Is there a way of using struts tags to test for the
validity of a specific form field. How would this
be
written? If not, what are the work arounds?
I'm not sure I understand what you want to do. You don't need to use any
tags to test whether form fields contain valid data; Struts will do that
for you based on your validator rules, as you describe above. The
<html:errors/> tag will then take care of figuring out whether there's
anything to display automatically.
L.
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]