feat: ✨ send message through htmx
This commit is contained in:
parent
b87ca298e9
commit
5969f7b57c
8 changed files with 198 additions and 110 deletions
|
@ -1 +1,5 @@
|
|||
Hello, {{name}}
|
||||
<!DOCTYPE html>
|
||||
<html>
|
||||
Hello {{name}}
|
||||
|
||||
</html>
|
||||
|
|
27
templates/main_page.html
Normal file
27
templates/main_page.html
Normal file
|
@ -0,0 +1,27 @@
|
|||
<!DOCTYPE html>
|
||||
<script src="https://unpkg.com/htmx.org@2.0.4"
|
||||
integrity="sha384-HGfztofotfshcF7+8n44JQL2oJmowVChPTg48S+jvZoztPfvwD79OC/LTtG6dMp+"
|
||||
crossorigin="anonymous"></script>
|
||||
<html>
|
||||
<h1 class="main">Contact</h1>
|
||||
<link rel="stylesheet" href="/assets/main.css">
|
||||
<form id="form" hx-post="/send" hx-target="this" required>
|
||||
<div class="main">
|
||||
<input type="text" name="name" id="name" placeholder="Name" required maxlength=1024 value="{{name}}"></input>
|
||||
</div>
|
||||
<div class="main">
|
||||
<input type="email" name="email" id="email" placeholder="Email" required maxlength=1024
|
||||
value="{{email}}"></input>
|
||||
</div>
|
||||
<div class="main">
|
||||
<textarea type="text" name="message" id="message" placeholder="Message" required minlength=16 maxlength=1024
|
||||
value="{{message}}"></textarea>
|
||||
</div>
|
||||
<div class="main">
|
||||
<button id="send" name="send" type="submit" hx-target="#form">
|
||||
Send
|
||||
</button>
|
||||
</div>
|
||||
</form>
|
||||
|
||||
</html>
|
Loading…
Add table
Add a link
Reference in a new issue