Empresas
Empleos
  • Sobre nosotros
  • Soluciones
    • Publicación de vacantes
      Publica tu vacante y recibe candidatos calificados en 48h.
    • Evaluación de candidatos
      500+ pruebas técnicas y psicológicas, más anti-fraude.
    • Headhunting
      Búsqueda ejecutiva a la medida de principio a fin.
    • Nómina + EOR
      Dispersión de nómina y EOR en más de 15 países de LATAM.
  • Precios
  • Empleos

0

126
Vistas
how show value of input select from database without click any button after select date?
<div class="col-md-12">
     <div class="form-group first">
        <label >Date_reservation</label>
        <input type="date" name="date_res">
     </div>
</div>
<div class="row">
     <div >
     <div class="form-group first">
        <label >Type_salle</label>
        <select   name="code_salle" >
          <option>STD1</option>
          <option>STD2</option>
          <option>STD3</option>
          <option>STD4</option>
      </select>
   </div>
 </div>
</div>

{{-- In the database, there is a table named rooms. I want to display all room details from the table(room) --}}

about 4 years ago · Juan Pablo Isaza
2 Respuestas
Responde la pregunta

0

You should change the PHP code with following code

<div class="col-md-12">
            <div class="form-group first">
                <label >Date_reservation</label>
                <input type="date" name="date_res" id="date_res">
            </div>
        </div>
        <div class="row">
            <div>
            <div class="form-group first">
                <label >Type_salle</label>
                <select name="code_salle" id="code_salle">
                   <option>STD1</option>
                   <option>STD2</option>
                   <option>STD3</option>
                   <option>STD4</option>
               </select>
           </div>
        </div>
        </div>

After that,You can use onchange function to fetch room details from the database(fetch_room_data.php, which is used to fetch the room table details from the database). Here, I will provide a sample code

$('#date_res').on('change', function() 
{                                                                  
$.ajax({
url:"fetch_room_data.php",
method:"POST",
success:function(data)
{ 
  $('#code_salle').html(data);
}
});
});
about 4 years ago · Juan Pablo Isaza Denunciar

0

You will need Javascript and an API Route, because you can't just connect html with your database that's not how it works.

An alternative option would be to use blade(a template engine for laravel).

about 4 years ago · Juan Pablo Isaza Denunciar
Responde la pregunta
Encuentra empleos remotos

¡Descubre la nueva forma de encontrar empleo!

Top de empleos
Top categorías de empleo
Empresas
Publicar vacante Precios Comercial
Legal
Términos y condiciones Política de privacidad
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomiéndame algunas ofertas
Necesito ayuda