Skip to content

Instantly share code, notes, and snippets.

@dcomartin
Created October 30, 2024 21:13
Show Gist options
  • Save dcomartin/f04641bfa36eeb6cb256d25a46306867 to your computer and use it in GitHub Desktop.
Save dcomartin/f04641bfa36eeb6cb256d25a46306867 to your computer and use it in GitHub Desktop.
<form hx-put="/contact/1" hx-target="this" hx-swap="outerHTML">
<div>
<label>First Name</label>
<input type="text" name="firstName" value="Joe">
</div>
<div class="form-group">
<label>Last Name</label>
<input type="text" name="lastName" value="Blow">
</div>
<div class="form-group">
<label>Email Address</label>
<input type="email" name="email" value="joe@blow.com">
</div>
<button class="btn">Submit</button>
<button class="btn" hx-get="/contact/1">Cancel</button>
</form>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment