Scene creadtion devices cant be empty

This commit is contained in:
JonatanRek 2019-10-11 16:52:52 +02:00
parent 2f838a529c
commit 8d02d7ff9e
2 changed files with 4 additions and 3 deletions

View File

@ -1,8 +1,9 @@
<?php
if (isset($_POST) && !empty($_POST)){
if (sset($_POST['devices']) && $_POST['devices'] != '') {
SceneManager::create($_POST['sceneIcon'], $_POST['sceneName'], json_encode($_POST['devices']));
}
//Debug
if (DEBUGMOD == 1) {

View File

@ -26,7 +26,7 @@
</div>
<div class="field">
<div class="label"><?php $LANGMNG->echo('l_choseDevice');?></div>
<select class="input" name="devices[]" multiple>
<select class="input" name="devices[]" multiple required>
<?php
foreach ($SUBDEVICES as $subdeviceId => $subdeviceData) {
echo '<option value="'.$subdeviceId.'">'.$subdeviceData['name'].'</option>';