@@ -230,7 +230,7 @@ export function form(id) {
230
230
231
231
event . preventDefault ( ) ;
232
232
233
- const form_data = new FormData ( form ) ;
233
+ const form_data = new FormData ( form , event . submitter ) ;
234
234
235
235
if ( DEV ) {
236
236
validate_form_data ( form_data , clone ( form ) . enctype ) ;
@@ -340,7 +340,7 @@ export function form(id) {
340
340
event . stopPropagation ( ) ;
341
341
event . preventDefault ( ) ;
342
342
343
- const form_data = new FormData ( form ) ;
343
+ const form_data = new FormData ( form , target ) ;
344
344
345
345
if ( DEV ) {
346
346
const enctype = target . hasAttribute ( 'formenctype' )
@@ -350,10 +350,6 @@ export function form(id) {
350
350
validate_form_data ( form_data , enctype ) ;
351
351
}
352
352
353
- if ( target . name ) {
354
- form_data . append ( target . name , target ?. getAttribute ( 'value' ) ?? '' ) ;
355
- }
356
-
357
353
await handle_submit ( form , form_data , callback ) ;
358
354
} ;
359
355
} ;
@@ -422,12 +418,12 @@ export function form(id) {
422
418
} ,
423
419
validate : {
424
420
/** @type {RemoteForm<any, any>['validate'] } */
425
- value : async ( { includeUntouched = false } = { } ) => {
421
+ value : async ( { includeUntouched = false , submitter } = { } ) => {
426
422
if ( ! element ) return ;
427
423
428
424
const id = ++ validate_id ;
429
425
430
- const form_data = new FormData ( element ) ;
426
+ const form_data = new FormData ( element , submitter ) ;
431
427
432
428
/** @type {readonly StandardSchemaV1.Issue[] } */
433
429
let array = [ ] ;
0 commit comments