28 lines
828 B
HTML
28 lines
828 B
HTML
---
|
|
title: message
|
|
---
|
|
<div class="container">
|
|
<div class="panel f">
|
|
<h2>contact</h2>
|
|
<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>
|
|
<textarea rows="8" cols="80" name="message"></textarea>
|
|
<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>
|