You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@commons.apache.org by co...@jakarta.apache.org on 2004/05/20 22:13:29 UTC
[Jakarta Commons Wiki] New: ValidatorMinimumSteps
Date: 2004-05-20T13:13:29
Editor: RobertBurrellDonkin <rd...@apache.org>
Wiki: Jakarta Commons Wiki
Page: ValidatorMinimumSteps
URL: http://wiki.apache.org/jakarta-commons/ValidatorMinimumSteps
Moved content from original wiki
New Page:
Up to ValidatorFaq
----
{{{
I want to use Validator for client-side
validation. I put definations in validation.xml, put
onsubmit="return validateRegistryForm(this);" in my jsp file and do not
touch validator-rules.xml. When I press submit button, the javascript
validation does not work.
Any wrong with that?
Leon
}}}
== Answer(s) ==
Minimum steps to have built-in validation working:
1. Add validation plug-in into the struts-config.xml
1. Put definitions in validation.xml
1. Add to the page:
a. In the head section: <html:javascript formName="<form_name>" />
a. for the form tag: onsubmit="return validate<form_name>(this)"
1. Create application resource file with required keys (if does not exist
yet)
1. Add reference to resource file into the struts-config.xml
P.S. it is possible to avoid step #4 and #5 if definitions in validation.xml
do not require resources.
Regards,
Sergey Smirnov
----
Up to ValidatorFaq
---------------------------------------------------------------------
To unsubscribe, e-mail: commons-dev-unsubscribe@jakarta.apache.org
For additional commands, e-mail: commons-dev-help@jakarta.apache.org