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

129
Vistas
HTML element dynamic

I made a input number field and want to dynamic render the value of this in the container without reloading the page. I'm using ajax for this but I still have to reload the page.

HTML:

        <form method="post">
            <div class="main">
                <label for="numb">Parcour</label><br><br>
                <input type="number" id="numb" min="1">
            </div>
            <div class="main" style="display: block;">
                <section id="erstellen">
                    
                </section>
            </div>
        </form>

js:

    const xhr = new XMLHttpRequest();
    xhr.open("POST","dynamisch_ajax.html", true);

    xhr.onload = () => {
        if(xhr.status === 200)
        {
            $('#erstellen').html($('#numb').val())
        } else {
            alert('Irgendetwas past nicht')
        }
    }

    xhr.send();
about 4 years ago · Juan Pablo Isaza
1 Respuestas
Responde la pregunta

0

you must use from preventDefault method to prevent default refresh :

$("form" ).submit(function( event ) {
  event.preventDefault();
  // The rest of the work
});
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