Course evaluation
Evaluate a course and its instructor.
Fields
Course nametextrequiredInstructortextOverall ratingselectCommentstextarea
Preview
Code
<script setup lang="ts">
import { ref } from "vue";
const sent = ref(false);
async function onSubmit(e: Event) {
const form = e.target as HTMLFormElement;
const res = await fetch("https://formward.eu/f/your-form-id", {
method: "POST",
headers: { Accept: "application/json" },
body: new FormData(form),
});
if (res.ok) {
sent.value = true;
form.reset();
}
}
</script>
<template>
<p v-if="sent">Thanks! Your message has been sent.</p>
<form v-else @submit.prevent="onSubmit">
<label for="course">Course name</label>
<input type="text" name="course" id="course" required />
<label for="instructor">Instructor</label>
<input type="text" name="instructor" id="instructor" />
<label for="rating">Overall rating</label>
<select name="rating" id="rating">
<option value="Excellent">Excellent</option>
<option value="Good">Good</option>
<option value="Average">Average</option>
<option value="Poor">Poor</option>
</select>
<label for="comments">Comments</label>
<textarea name="comments" id="comments"></textarea>
<input type="text" name="_gotcha" tabindex="-1" autocomplete="off" style="position:absolute;left:-9999px" aria-hidden="true" />
<button type="submit">Send</button>
</form>
</template>
Use this with Formward
Create a form, copy your endpoint, and replace https://formward.eu/f/your-form-id in the code above.