From 5e7ea208d4de00ee76d681fe6277a31e3a0b9412 Mon Sep 17 00:00:00 2001 From: Garvin Hicking Date: Thu, 4 Dec 2003 17:25:37 +0000 Subject: [PATCH] Fixed(?) unnullify function, adjusted necessary .js files --- libraries/tbl_change.js | 18 +++++++++--------- tbl_change.php | 24 ++++++++++++------------ tbl_row_delete.php | 7 ++++++- 3 files changed, 27 insertions(+), 22 deletions(-) diff --git a/libraries/tbl_change.js b/libraries/tbl_change.js index c9e13070d..43f1581d6 100644 --- a/libraries/tbl_change.js +++ b/libraries/tbl_change.js @@ -10,22 +10,22 @@ * * @return boolean always true */ -function nullify(theType, urlField, md5Field) +function nullify(theType, urlField, md5Field, multi_edit) { var rowForm = document.forms['insertForm']; - if (typeof(rowForm.elements['funcs[' + urlField + ']']) != 'undefined') { - rowForm.elements['funcs[' + urlField + ']'].selectedIndex = -1; + if (typeof(rowForm.elements['funcs' + multi_edit + '[' + urlField + ']']) != 'undefined') { + rowForm.elements['funcs' + multi_edit + '[' + urlField + ']'].selectedIndex = -1; } // "SET" field , "ENUM" field with more than 20 characters // or foreign key field if (theType == 1 || theType == 3 || theType == 4) { - rowForm.elements['field_' + md5Field + '[]'].selectedIndex = -1; + rowForm.elements['field_' + md5Field + multi_edit + '[]'].selectedIndex = -1; } // Other "ENUM" field else if (theType == 2) { - var elts = rowForm.elements['field_' + md5Field + '[]']; + var elts = rowForm.elements['field_' + md5Field + multi_edit + '[]']; // when there is just one option in ENUM: if (elts.checked) { elts.checked = false; @@ -39,7 +39,7 @@ function nullify(theType, urlField, md5Field) } // Other field types else /*if (theType == 5)*/ { - rowForm.elements['fields[' + urlField + ']'].value = ''; + rowForm.elements['fields' + multi_edit + '[' + urlField + ']'].value = ''; } // end if... else if... else return true; @@ -54,12 +54,12 @@ function nullify(theType, urlField, md5Field) * * @return boolean always true */ -function unNullify(urlField) +function unNullify(urlField, multi_edit) { var rowForm = document.forms['insertForm']; - if (typeof(rowForm.elements['fields_null[' + urlField + ']']) != 'undefined') { - rowForm.elements['fields_null[' + urlField + ']'].checked = false + if (typeof(rowForm.elements['fields_null' + multi_edit + '[' + urlField + ']']) != 'undefined') { + rowForm.elements['fields_null' + multi_edit + '[' + urlField + ']'].checked = false } // end if return true; diff --git a/tbl_change.php b/tbl_change.php index 8f29832e0..655fabda7 100644 --- a/tbl_change.php +++ b/tbl_change.php @@ -387,7 +387,7 @@ foreach($loop_array AS $vrowcount => $vrow) { } else { ?> - ="return unNullify('', '')" tabindex="" id="field__1"> $vrow) { } else { $onclick .= '5, '; } - $onclick .= '\'' . urlencode($field) . '\', \'' . md5($field) . '\'); this.checked = true}; return true" />' . "\n"; + $onclick .= '\'' . urlencode($field) . '\', \'' . md5($field) . '\', \'' . $vkey . '\'); this.checked = true}; return true" />' . "\n"; echo $onclick; } else { echo '  ' . "\n"; @@ -495,7 +495,7 @@ foreach($loop_array AS $vrowcount => $vrow) { - ="return unNullify('')" tabindex="" id="field__3" value="" /> + ="return unNullify('', '')" tabindex="" id="field__3" value="" /> @@ -507,7 +507,7 @@ foreach($loop_array AS $vrowcount => $vrow) { - ="return unNullify('', '')" tabindex="" id="field__3"> @@ -522,7 +522,7 @@ foreach($loop_array AS $vrowcount => $vrow) { + ="return unNullify('', '')" tabindex=""> $vrow) { + ="return unNullify('', '')" tabindex=""> $vrow) { if (strlen($row_table_def['Type']) > 20) { echo "\n"; ?> - ="return unNullify('', '')" tabindex="" id="field__3"> $vrow) { - ="return unNullify('', '')" tabindex="" id="field__3"> $vrow) { + ="return unNullify('', '')" tabindex="" > $vrow) { ?> - ="return unNullify('')" tabindex="" id="field__3" /> + ="return unNullify('', '')" tabindex="" id="field__3" /> $vrow) { echo "\n"; ?> + ="return unNullify('', '')" tabindex="" > - ="return unNullify('')" tabindex="" id="field__3" /> + ="return unNullify('', '')" tabindex="" id="field__3" />