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

206
Vistas
Is there a way to open a new panel everytime a button is clicked?

I have a panel that has 3 textareas for a user to add certain information. It then goes through the process of being saved to the database. On every click of a button, I want the same empty panel to appear which will allow the user to enter multiple entries

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

0

I put together this little code for you, hope it helps you

//Simple HTML with 3 textarea
<div>
    <form action="">
        <textarea name="" id="" cols="30" rows="10"></textarea>
        <textarea name="" id="" cols="30" rows="10"></textarea>
        <textarea name="" id="" cols="30" rows="10"></textarea>
        <span id="btn">Click me!</span>
    </form>
</div>

So anytime the button #btn is clicked, first the form is submitted and then the textarea is cleared.

// The Javascript
const
    btn = document.querySelector('#btn'),
    form = document.querySelector('form'),
    textarea = document.querySelectorAll('textarea')

function clearFields() {
    for (let i = 0; i < textarea.length; i++) {
        textarea[i].value = '';
    }
}

btn.addEventListener('click', function() {
    // functionality to asynchronously submit and save user entry to DB
    submitFormToServer()

    // Clear all the textarea
    clearFields()
})
about 4 years ago · Juan Pablo Isaza Denunciar

0

After button click event you could call a Redirect to the same page which will clear out the textboxes or explicitly clear them out (Textbox1.Text = "" etc.)

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