improved and fixed js stuff used with the new "null" checkbox

This commit is contained in:
Loïc Chapeaux
2002-01-06 17:29:00 +00:00
parent 7ac9691e2a
commit dbe02639dd
2 changed files with 17 additions and 3 deletions

View File

@@ -5,9 +5,13 @@ phpMyAdmin - Changelog
$Id$ $Id$
$Source$ $Source$
2001-01-06 Lo<4C>c Chapeaux <lolo@phpheaven.net>
* tbl_change.php3, lines 290-300: improved and fixed js stuff used with the
new "null" checkbox.
2002-01-06 Marc Delisle <lem9@users.sourceforge.net> 2002-01-06 Marc Delisle <lem9@users.sourceforge.net>
* libraries/display_tbl.lib.php3: typo thanks to * libraries/display_tbl.lib.php3: typo thanks to
yrtimd at users.sourceforge.net yrtimd at users.sourceforge.net
2001-01-05 Lo<4C>c Chapeaux <lolo@phpheaven.net> 2001-01-05 Lo<4C>c Chapeaux <lolo@phpheaven.net>
* main.php3, line 234: maximum database name size is 64 characters. * main.php3, line 234: maximum database name size is 64 characters.

View File

@@ -287,7 +287,17 @@ for ($i = 0; $i < $fields_cnt; $i++) {
if ($data == 'NULL') { if ($data == 'NULL') {
echo ' checked="checked"'; echo ' checked="checked"';
} }
echo ' onclick="if (this.checked) {document.forms[\'insertForm\'].elements[\'fields[' . urlencode($field) . ']\'].value = \'\'}; return true" />' . "\n"; if (strstr($row_table_def['True_Type'], 'enum')) {
if (strlen($row_table_def['Type']) > 20) {
echo ' onclick="if (this.checked) {document.forms[\'insertForm\'].elements[\'field_' . md5($field) . '[]\'].selectedIndex = -1}; return true" />' . "\n";
} else {
echo ' onclick="if (this.checked) {var elts = document.forms[\'insertForm\'].elements[\'field_' . md5($field) . '[]\']; var elts_cnt = elts.length; for (var i = 0; i < elts_cnt; i++ ) {elts[i].checked = false}}; return true" />' . "\n";
}
} else if (strstr($row_table_def['True_Type'], 'set')) {
echo ' onclick="if (this.checked) {document.forms[\'insertForm\'].elements[\'field_' . md5($field) . '[]\'].selectedIndex = -1}; return true" />' . "\n";
} else {
echo ' onclick="if (this.checked) {document.forms[\'insertForm\'].elements[\'fields[' . urlencode($field) . ']\'].value = \'\'}; return true" />' . "\n";
}
} else { } else {
echo ' &nbsp;' . "\n"; echo ' &nbsp;' . "\n";
} }