-
-
Save pbanigo/a531fd6945f3e2e1aa12895298e2bec4 to your computer and use it in GitHub Desktop.
Update form with EJS variables
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<!-- add header --> | |
<%- include('includes/_header') %> | |
<!-- end header --> | |
<!-- Main section --> | |
<main id="main"> | |
<a href="/"> | |
<span class="text-gradient"> All Drugs</span> | |
</a> | |
<h2>Edit <%= drug.name %></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="<%= drug.name %>" placeholder="Drug Name"> | |
</div> | |
<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> | |
<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> | |
<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> | |
<div class="form-group"> | |
<button type="submit">Edit Drug</button> | |
</div> | |
</div> | |
</form> | |
</main> | |
<!-- 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