DO NOT REPLY TO THIS EMAIL, BUT PLEASE POST YOUR BUG 
RELATED COMMENTS THROUGH THE WEB INTERFACE AVAILABLE AT
<http://issues.apache.org/bugzilla/show_bug.cgi?id=30872>.
ANY REPLY MADE TO THIS MESSAGE WILL NOT BE COLLECTED AND 
INSERTED IN THE BUG DATABASE.

http://issues.apache.org/bugzilla/show_bug.cgi?id=30872

Struts Validation - Client Side required field validation fails for SELECT lists and 
checkboxes

           Summary: Struts Validation - Client Side required field
                    validation fails for SELECT lists and checkboxes
           Product: Struts
           Version: 1.1 Final
          Platform: PC
        OS/Version: Windows XP
            Status: NEW
          Severity: Normal
          Priority: Other
         Component: Validator Framework
        AssignedTo: [EMAIL PROTECTED]
        ReportedBy: [EMAIL PROTECTED]


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.

---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to