Auto-select DB name fields when clicked

This commit is contained in:
Jamie Cameron
2013-01-24 14:09:32 -08:00
parent 5dc3fed7ee
commit 8def9d3d62

View File

@@ -574,14 +574,17 @@ if ($access{'perms'} == 2 && $access{'dbs'} ne '*') {
else {
# Can select any databases
local $ind = &indexof($_[0],@dbs) >= 0;
local $js1 = "onChange='form.db_def[1].checked = true'";
local $js2 = "onClick='form.db_def[2].checked = true'";
$rv = &ui_radio("db_def", $_[0] eq '%' || $_[0] eq '' ? 1 :
$ind ? 2 : 0,
[ [ 1, $text{'host_any'} ],
[ 2, $text{'host_sel'}." ".
&ui_select("dbs", $_[0], \@dbs) ],
&ui_select("dbs", $_[0], \@dbs, 1, 0, 0, 0, $js1) ],
[ 0, $text{'host_otherdb'}." ".
&ui_textbox("db", $_[0] eq '%' || $_[0] eq '' ||
$ind ? '' : $_[0], 30) ] ]);
$ind ? '' : $_[0], 30, 0,
undef, $js2) ] ]);
}
return $rv;
}