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

173
Vistas
I created a contact us form for my website but I dont know how to strore the data.(JS)

I was making a new service-based website and I created the contact form. When I put my info and submit it, the website refreshes but I don't know where that information goes. I want to be able to store it somewhere, like .txt or something. Thanks in advance. (I use JS).

<form action="">
          <h3>get in touch</h3>
          <input type="text" placeholder="your name" class="box" />
          <input type="email" placeholder="your email" class="box" />
          <input type="tel" placeholder="subject" class="box" />
          <textarea
            placeholder="your message"
            class="box"
            cols="30"
            rows="10"
          ></textarea>
          <input onclick="alert('Thanks For Your Response')" type="submit" value="send message" class="btn" />
          <span>OR</span>
          <a
            class="btn"
            href="tel:9724005492"
            >Call Now</a
          >
        </form>
about 4 years ago · Juan Pablo Isaza
1 Respuestas
Responde la pregunta

0

It goes to the URL specified in the action attribute.

The expectation is that you will have some server-side code ready (at that URL) to receive the data and process it.

MDN has a guide to sending and retrieving form data which covers how it works and has examples for a few programming languages.

You said you were using JS. If you are using server-side JS, then it is common to use Express.js, in which case you can set up a body parsing middleware and then read the data from req.body. You can then store it somewhere, which could be a text file, but it is more usual to use a database (which would handle race conditions if you ended up with simultaneous inserts).

MDN has a Working With Forms section in their Express.js tutorial

Client-side JS can't store the data anywhere that is particularly useful for the developer of the website, but you can add an event listener for the form element's submit event and then process the data on the client. There are a few places you could store it on the client (e.g. local storage) but that will stay with the browser and not get to the person running the website.

Client-side JS could also make its own HTTP request (i.e. Ajax) to a server-side program which processes the data. The net result is the same as submitting the form to one though, just with more control over the UI.

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