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);
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
}