@@ -230,7 +230,7 @@ export function form(id) {
230230
231231 event . preventDefault ( ) ;
232232
233- const form_data = new FormData ( form ) ;
233+ const form_data = new FormData ( form , event . submitter ) ;
234234
235235 if ( DEV ) {
236236 validate_form_data ( form_data , clone ( form ) . enctype ) ;
@@ -340,7 +340,7 @@ export function form(id) {
340340 event . stopPropagation ( ) ;
341341 event . preventDefault ( ) ;
342342
343- const form_data = new FormData ( form ) ;
343+ const form_data = new FormData ( form , target ) ;
344344
345345 if ( DEV ) {
346346 const enctype = target . hasAttribute ( 'formenctype' )
@@ -350,10 +350,6 @@ export function form(id) {
350350 validate_form_data ( form_data , enctype ) ;
351351 }
352352
353- if ( target . name ) {
354- form_data . append ( target . name , target ?. getAttribute ( 'value' ) ?? '' ) ;
355- }
356-
357353 await handle_submit ( form , form_data , callback ) ;
358354 } ;
359355 } ;
@@ -422,12 +418,12 @@ export function form(id) {
422418 } ,
423419 validate : {
424420 /** @type {RemoteForm<any, any>['validate'] } */
425- value : async ( { includeUntouched = false } = { } ) => {
421+ value : async ( { includeUntouched = false , submitter } = { } ) => {
426422 if ( ! element ) return ;
427423
428424 const id = ++ validate_id ;
429425
430- const form_data = new FormData ( element ) ;
426+ const form_data = new FormData ( element , submitter ) ;
431427
432428 /** @type {readonly StandardSchemaV1.Issue[] } */
433429 let array = [ ] ;
0 commit comments