EJS not functional in input tag | Sololearn: Learn to code for FREE!

-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="[email protected]"/> </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 ==

2/27/2022 11:22:16 AM

Logos

8 Answers

New Answer

0

Logos can you share gut hub of this...to repro

0

@B.VIDYADHAR VIJJU https://github.com/EddyRicchy/CRUD-App.git It's in the master branch. I will really appreciate your help.

0

Logos apart from readme.md file I haven't find anything in this git hub repository

0

B.VIDYADHAR VIJJU Check the master branch.

0

B.VIDYADHAR VIJJU https://github.com/EddyRicchy/CRUD-App/tree/master

0

Logos can we connect over Google meet To check further.. I have gone through your code

0

B.VIDYADHAR VIJJU Can we use WhatsApp?

0

Logos Google meet is easy