Live demo: https://andreterron-form_demo.web.val.run/
Create a form that posts to your val:
<form action="https://andreterron-form_handler.web.val.run" method="post"> <label for="username">Val Town username:</label> <input name="username" type="text"> <button type="submit">Submit</button> </form>
And get your results stored as an array:
// set by andreterron.form_handler at 2023-08-10T21:04:43.364Z
let formResponses = [{
"username": "andreterron",
},
{
"username": "stevekrouse",
}];
action
attribute of your formCheck out the example val: https://www.val.town/v/andreterron.form_demo
This val saves to another val (@me.formResponse
), which has a 100kb limitation (250kb for pro
users), if you want to store them in a more scalable solution, check out our guides
Migrated from folder: A_Make_A_Val_Day/_23_08_10_Forms/form_handler