You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@commons.apache.org by "Niall Pemberton (JIRA)" <ji...@apache.org> on 2006/07/19 15:22:28 UTC
[jira] Updated: (VALIDATOR-126) [validator] More generic handling
of form field values
[ http://issues.apache.org/jira/browse/VALIDATOR-126?page=all ]
Niall Pemberton updated VALIDATOR-126:
--------------------------------------
Component/s: Framework
> [validator] More generic handling of form field values
> ------------------------------------------------------
>
> Key: VALIDATOR-126
> URL: http://issues.apache.org/jira/browse/VALIDATOR-126
> Project: Commons Validator
> Issue Type: Improvement
> Components: Framework
> Environment: Operating System: Windows XP
> Platform: PC
> Reporter: Harvey
> Priority: Minor
> Attachments: js.patch
>
>
> This validation works for server side, but does not work for client side. The
> lines in validation.xml are:
> <field property="groupId" depends="required">
> <arg0 key="evaluationForm.groupId"/>
> </field>
> <field property="reviewers" depends="required">
> <arg0 key="evaluationForm.reviewers"/>
> </field>
> (group_id is the list, reviewers are the checkboxes). No JS errors are
> generated in Mozilla. I have the following Struts-generated JS code (this is a
> partial, but relevant listing):
> ======================================================================
> function validateEvaluationForm(form)
> {
> if (bCancel)
> return true;
> else
> return validateMaxLength(form) && validateRequired(form) &&
> validateIntRange(form);
> }
> function maxlength () {
> this.aa = new Array("message", "Message can not be greater than 4000
> characters.", new Function ("varName", "this.maxlength='4000'; return this
> [varName];"));
> }
> function required () {
> this.aa = new Array("groupId", "Evaluation group is required.", new
> Function ("varName", " return this[varName];"));
> this.ab = new Array("reviewers", "Reviewers is required.", new Function
> ("varName", " return this[varName];"));
> this.ac = new Array("deadline.date", "Deadline day is required.", new
> Function ("varName", "this.min='1'; this.max='31'; return this[varName];"));
> }
> function intRange () {
> this.aa = new Array("deadline.date", "Deadline day is not in the range 1
> through 31.", new Function ("varName", "this.min='1'; this.max='31'; return
> this[varName];"));
> }
> ======================================================================
> Finally, the lines I get when the JS does not catch this validation and the
> form is submitted (i.e., server side validation) are (and these are correct):
> * Please provide a Program Group
> * Please provide at least one reviewer
> Thank you.
--
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: http://issues.apache.org/jira/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira
---------------------------------------------------------------------
To unsubscribe, e-mail: commons-dev-unsubscribe@jakarta.apache.org
For additional commands, e-mail: commons-dev-help@jakarta.apache.org