- 1

EJS not functional in input tag

I want to update the value of the input tag based on the user so that they can easily make changes to the inform without typing everything all over again. But this ejs syntax I am using right now doesn't work. The values of the user data doesn't display in the form. What can I do? This is my code: <form action="http://localhost:3000/api/users" method="POST" id="add_user"> <div class="new_user"> <div class="form-group"> <label for="name" class="text-light">Name</label> <input type="hidden" name="id" value="<%= user._id %>"/> <input type="text" name="name" value="<%= user.name %>" placeholder="Mark Stoenis"/> </div> <div class="form-group"> <label for="email" class="text-light">Email</label> <input type="text" name="email" value="<%= user.email %>" placeholder="example@gmail.com"/> </div> <div class="form-group"> <label for="gender" class="text-light">Gender</label> <div class="radio inline"> <input type="radio" name="gender" value="Male" id="radio-2" <%= user.gender == 'Male' ? 'checked' : '' %>/> <label for="radio-2" class="radio-label">Male</label> </div> <div class="radio inline"> <input type="radio" name="gender" value="Female" id="radio-3" <%= user.gender == 'Female' ? 'checked' : '' %>/> <label for="radio-3" class="radio-label">Female</label> </div> </div> <div class="form-group"> <label for="gender" class="text-light">Status</label> <div class="radio inline"> <input type="radio" name="gender" value="Active" id="radio-4" <%= user.status == 'active' ? 'checked' : '' %>/> <label for="radio-4" class="radio-label">Active</label> </div> <div class="radio inline"> <input type="radio" name="gender" value="Inactive" id="radio-5" <%= user.gender ==

27th Feb 2022, 11:22 AM
Logos
Logos - avatar
8 Réponses
0
Logos can you share gut hub of this...to repro
28th Feb 2022, 6:34 AM
B.VIDYADHAR VIJJU
B.VIDYADHAR VIJJU - avatar
0
@B.VIDYADHAR VIJJU https://github.com/EddyRicchy/CRUD-App.git It's in the master branch. I will really appreciate your help.
28th Feb 2022, 2:33 PM
Logos
Logos - avatar
0
Logos apart from readme.md file I haven't find anything in this git hub repository
28th Feb 2022, 3:26 PM
B.VIDYADHAR VIJJU
B.VIDYADHAR VIJJU - avatar
0
B.VIDYADHAR VIJJU Check the master branch.
1st Mar 2022, 1:11 PM
Logos
Logos - avatar
0
Logos can we connect over Google meet To check further.. I have gone through your code
1st Mar 2022, 4:50 PM
B.VIDYADHAR VIJJU
B.VIDYADHAR VIJJU - avatar
0
B.VIDYADHAR VIJJU Can we use WhatsApp?
1st Mar 2022, 8:48 PM
Logos
Logos - avatar
0
Logos Google meet is easy
2nd Mar 2022, 3:57 AM
B.VIDYADHAR VIJJU
B.VIDYADHAR VIJJU - avatar