File tree Expand file tree Collapse file tree 1 file changed +8
-7
lines changed Expand file tree Collapse file tree 1 file changed +8
-7
lines changed Original file line number Diff line number Diff line change @@ -337,21 +337,22 @@ export function superForm<
337337 }
338338
339339 // Detect if a form is posted without JavaScript.
340- const postedForm = get ( page ) . form ;
341- if ( postedForm && typeof postedForm === 'object' ) {
342- for ( const superForm of Context_findValidationForms (
343- postedForm
340+ const postedData = get ( page ) . form ;
341+ if ( postedData && typeof postedData === 'object' ) {
342+ for ( const postedForm of Context_findValidationForms (
343+ postedData
344344 ) . reverse ( ) ) {
345- if ( superForm . id === _formId ) {
345+ if ( postedForm . id === _formId ) {
346346 const pageDataForm = form as Validation < T , M > ;
347- form = superForm as Validation < T , M > ;
347+ form = postedForm as Validation < T , M > ;
348348 // Do the non-use:enhance stuff
349349 if (
350350 form . valid &&
351351 options . resetForm &&
352352 ( options . resetForm === true || options . resetForm ( ) )
353353 ) {
354- form . data = clone ( pageDataForm . data ) ;
354+ form = clone ( pageDataForm ) ;
355+ form . message = postedForm . message ;
355356 }
356357 break ;
357358 }
You can’t perform that action at this time.
0 commit comments