mirror of
https://github.com/hazemKrimi/personal-website.git
synced 2026-05-01 18:00:26 +00:00
Contact form script wip
This commit is contained in:
@@ -41,3 +41,7 @@ form input,
|
|||||||
form textarea {
|
form textarea {
|
||||||
width: 100%;
|
width: 100%;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
form button {
|
||||||
|
cursor: pointer;
|
||||||
|
}
|
||||||
|
|||||||
@@ -0,0 +1,4 @@
|
|||||||
|
document.querySelector('form').addEventListener('submit', (event) => {
|
||||||
|
event.preventDefault();
|
||||||
|
console.log(new FormData(event.target));
|
||||||
|
});
|
||||||
@@ -1,10 +1,21 @@
|
|||||||
{{ $styles := resources.Get "css/partials/contact-form.css" | toCSS | minify }}
|
{{ $styles := resources.Get "css/partials/contact-form.css" | toCSS | minify }}
|
||||||
|
{{ $scripts := resources.Get "js/partials/contact-form.js" | js.Build | minify }}
|
||||||
|
|
||||||
<link rel="stylesheet" href="{{ $styles.Permalink }}">
|
<link rel="stylesheet" href="{{ $styles.Permalink }}" />
|
||||||
|
<script defer src="{{ $scripts.Permalink }}"></script>
|
||||||
|
|
||||||
<form action="{{ .Site.Params.formSpreeURL }}" method="post">
|
<form
|
||||||
<input name="name" placeholder="Your name" type="text" />
|
action="{{ .Site.Params.formSpreeURL }}"
|
||||||
<input name="email" placeholder="Your email" type="email" />
|
method="POST"
|
||||||
<textarea cols="30" name="message" placeholder="Enter your message here" rows="10"></textarea>
|
>
|
||||||
|
<input name="name" placeholder="Your name" required type="text" />
|
||||||
|
<input name="email" placeholder="Your email" required type="email" />
|
||||||
|
<textarea
|
||||||
|
cols="30"
|
||||||
|
name="message"
|
||||||
|
placeholder="Your message"
|
||||||
|
required
|
||||||
|
rows="10"
|
||||||
|
></textarea>
|
||||||
<button type="submit">Submit</button>
|
<button type="submit">Submit</button>
|
||||||
</form>
|
</form>
|
||||||
|
|||||||
Reference in New Issue
Block a user