File tree Expand file tree Collapse file tree 4 files changed +71
-0
lines changed
Expand file tree Collapse file tree 4 files changed +71
-0
lines changed Original file line number Diff line number Diff line change @@ -102,3 +102,22 @@ export class AppComponent {
102102 })
103103}
104104```
105+
106+ > In a situation where you want to be able to submit in a invalid state ` canSubmitWhenInvalid ` boolean flag can be provided to useForm.
107+
108+ ``` angular-ts
109+ import { injectForm } from '@tanstack/angular-form';
110+
111+ export class AppComponent {
112+ form = injectForm({
113+ defaultValues: {
114+ data: '',
115+ },
116+ canSubmitWhenInvalid: true,
117+ onSubmit: async ({ value }) => {
118+ // Do something with the values
119+ console.log(value)
120+ },
121+ });
122+ }
123+ ```
Original file line number Diff line number Diff line change @@ -91,3 +91,18 @@ const form = useForm({
9191 },
9292})
9393```
94+
95+ > In a situation where you want to be able to submit in a invalid state ` canSubmitWhenInvalid ` boolean flag can be provided to useForm.
96+
97+ ``` tsx
98+ const form = useForm ({
99+ defaultValues: {
100+ data: ' ' ,
101+ },
102+ canSubmitWhenInvalid: true ,
103+ onSubmit : async ({ value }) => {
104+ // Do something with the values
105+ console .log (value )
106+ },
107+ })
108+ ```
Original file line number Diff line number Diff line change @@ -96,3 +96,20 @@ const form = createForm(() => ({
9696 },
9797}))
9898```
99+
100+ > In a situation where you want to be able to submit in a invalid state ` canSubmitWhenInvalid ` boolean flag can be provided to useForm.
101+
102+ ``` tsx
103+ import { createForm } from ' @tanstack/solid-form'
104+
105+ const form = createForm (() => ({
106+ defaultValues: {
107+ data: ' ' ,
108+ },
109+ canSubmitWhenInvalid: true ,
110+ onSubmit : async ({ value }) => {
111+ // Do something with the values
112+ console .log (value )
113+ },
114+ }))
115+ ```
Original file line number Diff line number Diff line change @@ -97,3 +97,23 @@ const form = useForm({
9797 <!-- ... -->
9898</template>
9999```
100+
101+ > In a situation where you want to be able to submit in a invalid state ` canSubmitWhenInvalid ` boolean flag can be provided to useForm.
102+
103+ ``` vue
104+ <script setup lang="ts">
105+ import { useForm } from '@tanstack/vue-form'
106+
107+ const form = useForm({
108+ defaultValues: { data: '' },
109+ canSubmitWhenInvalid: true,
110+ onSubmit: async ({ value }) => {
111+ // Do something with the values
112+ console.log(value)
113+ },
114+ })
115+ </script>
116+ <template>
117+ <!-- ... -->
118+ </template>
119+ ```
You can’t perform that action at this time.
0 commit comments