Skip to content

Instantly share code, notes, and snippets.

Created June 20, 2022 05:32
What would you like to do?
Update form with EJS variables
<!-- add header -->
<%- include('includes/_header') %>
<!-- end header -->
<!-- Main section -->
<main id="main">
<a href="/">
<span class="text-gradient"> All Drugs</span>
<h2>Edit <%= %></h2>
<span>Use the below form to edit a drug</span>
<!-- Update drug form -->
<form method="POST" id="update_drug">
<div class="new_drug">
<div class="form-group">
<label for="name" class="text-light">Drug Name</label>
<input type="hidden" name="id" value="<%= drug._id %>">
<input type="text" name="name" value="<%= %>" placeholder="Drug Name">
<div class="form-group">
<label for="card" class="text-light">Tablets per Card</label>
<input type="number" name="card" value="<%= drug.card %>" placeholder="Tablets per Card" min="1" max="500">
<div class="form-group">
<label for="pack" class="text-light">Tablets per Pack</label>
<input type="number" name="pack" value="<%= drug.pack %>" placeholder="Tablets per Pack" min="1" max="500">
<div class="form-group">
<label for="perDay" class="text-light">Taken per day</label>
<input type="number" name="perDay" value="<%= drug.perDay %>" placeholder="Taken per day" min="1" max="500">
<div class="form-group">
<button type="submit">Edit Drug</button>
<!-- End main section -->
<!-- add footer -->
<%- include('includes/_footer') %>
<!-- end footer
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment