<html>
<meta http-equiv="Content-type" content="text/html; charset=utf-8" />
<head>
<script src="https://ajax.googleapis.com/ajax/libs/jquery/3.2.1/jquery.min.js"></script>
<script>
$(function(){
$(document).on('change','#mySelect',function(){
var value = $(this).val();
$('#myInput').val(value);
$('#myInput2').val(value);
});
});
</script>
<?php
require ('conexion.php');
if (!$conn->set_charset("utf8")) {
printf("Error loading character set utf8: %s\n", $conn->error);
}
$result = $conn->query("SELECT * from business");
//config form
echo '<form accept-charset="utf-8" action="generarqr.php" method="post">';
echo '<select id="mySelect">';
echo '<option value="" disabled selected>Seleccione la empresa</option>';
while ($row = mysqli_fetch_array($result)) {
echo '<option value="'. $row['Nombre'].'">'. $row['Nombre'].'</option>';
}
echo '</select>';
echo '<input id="myInput" name="data"/>';
echo '<select id="mySelect2">';
echo '<option value="" disabled selected>Seleccione la empresa</option>';
while ($row = mysqli_fetch_array($result)) {
echo '<option value="'. $row['id'].'">'. $row['Nombre'].'</option>';
}
echo '</select>';
echo '<input id="myInput2" name="ids"/>';
echo '<input type="submit" value="GENERATE"></form>';
?>
<script>
$(function () {
$(document).on('change', '#mySelect', function () {
var value = $(this).val();
$('#myInput').val(value);
$('#myInput2').val(value);
});
});
</script>
</head>
</html>
<?php
require('conexion.php');
if (!$conn->set_charset("utf8")) {
printf("Error loading character set utf8: %s\n", $conn->error);
}
$result = $conn->query("SELECT * from business");
//config form
echo '<form accept-charset="utf-8" action="generarqr.php" method="post">';
echo '<select id="mySelect">';
echo '<option value="" disabled selected>Seleccione la empresa</option>';
while ($row = mysqli_fetch_array($result)) {
echo '<option value="' . $row['Nombre'] . '">' . $row['Nombre'] . '</option>';
}
echo '</select>';
echo '<input id="myInput" name="data"/>';
echo '<select id="mySelect2">';
echo '<option value="" disabled selected>Seleccione la empresa</option>';
while ($row = mysqli_fetch_array($result)) {
echo '<option value="' . $row['id'] . '">' . $row['Nombre'] . '</option>';
}
echo '</select>';
echo '<input id="myInput2" name="ids"/>';
echo '<input type="submit" value="GENERATE"></form>';
?>
set_charset("utf8")){printf("Error loading character set utf8: %s\n", $conn->error);}$result = $conn->query("SELECT * from business");//config formecho '';echo '';echo 'Seleccione la empresa';while($row = mysqli_fetch_array($result)){echo ''. $row['Nombre'].'';}echo '';echo '';echo ''; echo 'Seleccione la empresa'; while ($row = mysqli_fetch_array($result)) { echo ''. $row['Nombre'].''; } echo ''; echo ''; echo '';
?>