rleland     2003/09/08 23:20:43

  Modified:    conf/share validator-rules.xml
  Log:
  Bug 11520  patch supplied by Marcus Brito
  Finish applying patches to handle radio types in 'required js rule'
  
  Revision  Changes    Path
  1.39      +18 -4     jakarta-struts/conf/share/validator-rules.xml
  
  Index: validator-rules.xml
  ===================================================================
  RCS file: /home/cvs/jakarta-struts/conf/share/validator-rules.xml,v
  retrieving revision 1.38
  retrieving revision 1.39
  diff -u -r1.38 -r1.39
  --- validator-rules.xml       15 Aug 2003 19:33:52 -0000      1.38
  +++ validator-rules.xml       9 Sep 2003 06:20:43 -0000       1.39
  @@ -63,6 +63,7 @@
                   var i = 0;
                   var fields = new Array();
                   oRequired = new required();
  +
                   for (x in oRequired) {
                        var field = form[oRequired[x][0]];
                        
  @@ -70,7 +71,6 @@
                           field.type == 'textarea' ||
                           field.type == 'file' ||
                           field.type == 'select-one' ||
  -                        field.type == 'radio' ||
                           field.type == 'password') {
                           
                           var value = '';
  @@ -91,6 +91,20 @@
                                }
                                fields[i++] = oRequired[x][1];
                                isValid = false;
  +                        }
  +                    } else if ((field.length > 0) && (field[0].type == 'radio')) {
  +                        isChecked=-1;
  +                        for (loop=0;loop < field.length;loop++) {
  +                            if (field[loop].checked) {
  +                                isChecked=loop;
  +                            }
  +                        }
  +                        if (isChecked < 0) {
  +                            if (i == 0) {
  +                                focusField = field[0];
  +                            }
  +                            fields[i++] = oRequired[x][1];
  +                            isValid=false;
                           }
                       }
                   }
  
  
  

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

Reply via email to