-
Notifications
You must be signed in to change notification settings - Fork 0
/
form.php
41 lines (36 loc) · 1.02 KB
/
form.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
<script src="https://ajax.googleapis.com/ajax/libs/jquery/2.2.4/jquery.min.js"></script>
<!-- Select device form -->
<form class="form-horizontal">
<fieldset>
<!-- Form Name -->
<legend>Select device</legend>
<!-- Select Basic -->
<div class="form-group">
<label class="col-md-4 control-label" for="form"></label>
<div class="col-md-4">
<select id="form" name="form" class="form-control">
<option value="" selected="selected"></option>
<?php
$result = db_query("SELECT * FROM `forms` ORDER BY `form-name` ASC");
while ($row = $result->fetch_assoc()) {
echo "<option value='" . $row['formshort'] ."'>" . $row['form-name'] ."</option>";
}
?>
</select>
</div>
</div>
</fieldset>
</form>
<!-- End select device form -->
<?php
$result = db_query("SELECT * FROM `forms`");
while($row = mysqli_fetch_assoc($result)){
$source = $row['form'];
eval ($source);
}
?>
<script>
$("#form").on("change", function() {
$("#" + $(this).val()).show().siblings().hide();
})
</script>