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

368
Vistas
How to save non-input field(which is coming from DB) in different database table in node.js?

I am trying to save user login id (which is coming when user logged in application) in different table(User_assessment).But user_assessment table have different input form.So when itry to export only user input data getting export and i am only able to save assessment data not the user login details.I want to save assessment data with user login detaile so when i check the history data only come for the user who logged in. the export code and HTMl is given below:-

HTML:-some part of code

<div class="form-group">
                            <label for="fullName"><b>User Name : </b></label>
                            <a name = "namehelp">{{user.User_Name}}</a>
                            <label for="fullName"><b>User Email : </b></label>
                            <a name = "UserEmail">{{user.User_Email}}</a>
                          </div>
                          <div class="form-group">
                            <label for="fullName">Team/Project Name </label>
                            <input type="name" required class="form-control" name="TeamName" id="fullName" aria-describedby="nameHelp" placeholder="Enter full project name" >
                            <small id="nameHelp" class="form-text text-muted">Please enter your team/project name.</small>
                          </div>

auth.js :-

exports.assessment = (req,res) => {
    console.log(req.body);
over 4 years ago · Santiago Trujillo
1 Respuestas
Responde la pregunta

0

Set an onsubmit on your form and in its function first stop default behavior of form with e.preventDefault() and then get your inputs data and add your login id and then send them with an ajax request to nodejs.

<form id="myForm" onsubmit="yourFunction(event)" >
<!-- some inputs -->
</form>

yourFunction(e){
  e.preventDefault();
  let data = new FormData(e.target)
  data.append("loginId" , yourLoginId)

  // create XMLHttpRequest and send data to nodejs
}
over 4 years ago · Santiago Trujillo 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