Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

367
Views
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 answers
Answer question

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 Report
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!