Only populate monitorNames if query is valid
This commit is contained in:
parent
933259f9a5
commit
0742217599
|
@ -37,11 +37,13 @@ controlOptions[<?php echo $row['Id'] ?>][<?php echo $i ?>] = '<?php echo transla
|
|||
var monitorNames = new Object();
|
||||
<?php
|
||||
$query = empty($_REQUEST['mid']) ? dbQuery('SELECT Name FROM Monitor') : dbQuery('SELECT Name FROM Monitors WHERE Id != ?', array($_REQUEST['mid']) );
|
||||
if ( $query ) {
|
||||
while ( $name = dbFetchNext($query, 'Name') ) {
|
||||
?>
|
||||
monitorNames['<?php echo validJsStr($name) ?>'] = true;
|
||||
<?php
|
||||
} // end foreach
|
||||
} # end if query
|
||||
?>
|
||||
|
||||
function validateForm( form ) {
|
||||
|
|
Loading…
Reference in New Issue