bug 4464: properly check if a subfield is populated if it is in a textarea
authorGalen Charlton <gmcharlt@gmail.com>
Fri, 21 May 2010 17:00:58 +0000 (13:00 -0400)
committerChris Cormack <chrisc@catalyst.net.nz>
Mon, 24 May 2010 18:55:41 +0000 (06:55 +1200)
Subfields whose contents are longer than 100 characters are represented on the
bib form using a <textarea> instead of a text <input>.  The check on whether
at least one subfield for a mandatory field is populated wasn't not
checking for <textarea> subfields.

Signed-off-by: Galen Charlton <gmcharlt@gmail.com>
koha-tmpl/intranet-tmpl/prog/en/modules/cataloguing/addbiblio.tmpl

index 6c4a2c4..3e41f04 100644 (file)
@@ -148,6 +148,14 @@ function AreMandatoriesNotOk(){
                                        }
                        }
                }
+
+               elemtextareas = elem.getElementsByTagName('textarea');
+               for(var j=0,len2=elemtextareas.length; j<len2; j++){
+                // this bit assumes that the only textareas in this context would be for subfields
+                if (elemtextareas[j].value) {
+                    isempty = false;
+                }
+            }
        }else{
                isempty = false;
        }