contact
This commit is contained in:
parent
95e1b9d714
commit
01cad4a53e
|
|
@ -4,7 +4,7 @@ title: message
|
|||
<div class="container">
|
||||
<div class="panel f">
|
||||
<h2>contact</h2>
|
||||
<form method="post" action="/_/message">
|
||||
<form method="post" action="/_/message" id="form">
|
||||
<label><input type="text" name="name" value="" required>name</label>
|
||||
<label><input type="text" name="email" value="">email / other contact info</label>
|
||||
<br>
|
||||
|
|
@ -12,5 +12,16 @@ title: message
|
|||
<br>
|
||||
<input type="submit" value="submit">
|
||||
</form>
|
||||
<script type="module">
|
||||
import { popup } from '/static/util.js'
|
||||
const form = document.getElementById('form')
|
||||
form.onsubmit = e => {
|
||||
e.preventDefault();
|
||||
fetch(e.target.action, {method: 'POST', body: new FormData(e.target)}).then(() => {
|
||||
popup('submitted!');
|
||||
form.reset();
|
||||
});
|
||||
}
|
||||
</script>
|
||||
</div>
|
||||
</div>
|
||||
|
|
|
|||
|
|
@ -43,6 +43,9 @@ input, textarea {
|
|||
border: 1px solid var(--fg);
|
||||
margin: 5px;
|
||||
}
|
||||
input[type=submit] {
|
||||
cursor: pointer;
|
||||
}
|
||||
table, th, td {
|
||||
border: 1px dashed var(--fg);
|
||||
border-collapse: collapse;
|
||||
|
|
|
|||
Loading…
Reference in a new issue