htmx_examples/templates/partials/click_to_edit_contact_put.html

18 lines
609 B
HTML

<form hx-put="/contact/{{ id }}" hx-target="this" hx-swap="outerHTML">
<div>
<label>First Name</label>
<input type="text" name="firstName" value="{{ contact['name'] }}">
</div>
<div class="form-group">
<label>Last Name</label>
<input type="text" name="lastName" value="{{ contact['surname'] }}">
</div>
<div class="form-group">
<label>Email Address</label>
<input type="email" name="email" value="{{ contact['email'] }}">
</div>
<button class="btn">Submit</button>
<button class="btn" hx-get="/contact/{{ id }}">Cancel</button>
</form>