Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -441,7 +441,7 @@ We can also implement progressive enhancement ourselves, without `use:enhance`,
/** @param {SubmitEvent & { currentTarget: EventTarget & HTMLFormElement}} event */
async function handleSubmit(event) {
event.preventDefault();
const data = new FormData(event.currentTarget);
const data = new FormData(event.currentTarget, event.submitter);

const response = await fetch(event.currentTarget.action, {
method: 'POST',
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -428,7 +428,7 @@ For client-side validation, you can specify a _preflight_ schema which will popu

const schema = v.object({
title: v.pipe(v.string(), v.nonEmpty()),
content:v.pipe(v.string(), v.nonEmpty())
content: v.pipe(v.string(), v.nonEmpty())
});
</script>

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2352,6 +2352,8 @@ type RemoteForm<
/** Validate the form contents programmatically */
validate(options?: {
includeUntouched?: boolean;
/** Perform validation as if the form was submitted by the given button. */
submitter?: HTMLButtonElement | HTMLInputElement;
}): Promise<void>;
/** The result of the form submission */
get result(): Output | undefined;
Expand Down