When ENUM field has just one value, it could not be set to NULL (bug #783533).

This commit is contained in:
Michal Čihař
2003-08-05 17:33:04 +00:00
parent a740693bdc
commit 7204e154e9
2 changed files with 12 additions and 4 deletions

View File

@@ -26,10 +26,16 @@ function nullify(theType, urlField, md5Field)
// Other "ENUM" field
else if (theType == 2) {
var elts = rowForm.elements['field_' + md5Field + '[]'];
var elts_cnt = elts.length;
for (var i = 0; i < elts_cnt; i++ ) {
elts[i].checked = false;
} // end for
// when there is just one option in ENUM:
if (elts.checked) {
elts.checked = false;
} else {
var elts_cnt = elts.length;
for (var i = 0; i < elts_cnt; i++ ) {
elts[i].checked = false;
} // end for
} // end if
}
// Other field types
else /*if (theType == 5)*/ {