shuber      2004/10/28 20:16:57 CEST

  Modified files:        (Branch: JAHIA-4-0-BRANCH)
    src/views/jsp/jahia/engines/shared page_field.jsp 
  Log:
  Bugfix :
  - Javascript check() method should now work even when we have only one radio button 
in the page field display. The problem was that we were using 
document.mainForm.operation.length on an <input> radio tags that had only one radio 
button, in which case the document.mainForm.operation.length method call returns void.
  
  Revision  Changes    Path
  1.37.4.7  +9 -2      jahia/src/views/jsp/jahia/engines/shared/page_field.jsp
http://jahia.mine.nu:8080/cgi-bin/cvsweb.cgi/jahia/src/views/jsp/jahia/engines/shared/page_field.jsp.diff?r1=1.37.4.6&r2=1.37.4.7&f=h
  
  
  
  Index: page_field.jsp
  ===================================================================
  RCS file: 
/home/cvs/repository/jahia/src/views/jsp/jahia/engines/shared/Attic/page_field.jsp,v
  retrieving revision 1.37.4.6
  retrieving revision 1.37.4.7
  diff -u -r1.37.4.6 -r1.37.4.7
  --- page_field.jsp    27 Oct 2004 14:21:55 -0000      1.37.4.6
  +++ page_field.jsp    28 Oct 2004 18:16:57 -0000      1.37.4.7
  @@ -115,8 +115,15 @@
   
       // Test if checked
       checked = false;
  -    for (var i = 0; i < document.mainForm.operation.length; i++) {
  -        if (document.mainForm.operation[i].checked) {
  +    if (document.mainForm.operation.length > 1) {
  +        for (var i = 0; i < document.mainForm.operation.length; i++) {
  +            if (document.mainForm.operation[i].checked) {
  +                checked = true;
  +            }
  +        }
  +    } else {
  +        // if operation == 1 then we have to test differently.
  +        if (document.mainForm.operation.checked) {
               checked = true;
           }
       }
  

Reply via email to