Comments (5)
Thanks for your feedback! I will consider it when rewriting the library at some point in the future.
from modular-forms.
Is your motivation to execute different logic when a certain button is clicked?
from modular-forms.
Yes, different logic for each button but sharing the same form/data. For my particular case now it's different api endpoints for saving the data.
from modular-forms.
This is already possible. Just use a button with an event handler and check with validate
if your form is valid.
<Form>
<Field>...</Field>
<button onclick={async () => {
if (await validate(form)) {
// ...
}
}}>
Action 1
</button>
<button onclick={async () => {
if (await validate(form)) {
// ...
}
}}>
Action 2
</button>
</Form>
from modular-forms.
Right, but if I also want to update the submit states and response state, I am essentially rewriting the entire function that's in the Form onSubmit event. Granted, it's still not that much, but this sparked my idea to just pull it out to its own method.
from modular-forms.
Related Issues (20)
- [React] Feature Request: Decouple Form and FormStore creation from components. HOT 2
- Form validation doesn't work when used with `valiForm` HOT 1
- Form shows as dirty when text input is focused but not changed.
- Zod Validation doesn't work with auto form. HOT 2
- [Solid] Is there a way to use field array with external store? HOT 1
- FieldValue does not accept bigint HOT 1
- Setting initial error state for a form field HOT 1
- [solidjs][typescript] Getting typing right in the LoginForm example HOT 6
- valiForm error HOT 1
- Local Date Input from UTC Date HOT 16
- Typescript Errors HOT 6
- Using SolidJS ref for custom component HOT 6
- Optional alternate behaviour for revalidateOn HOT 3
- toPhoneNumber tranform example allows alpha characters HOT 3
- Field onChange event HOT 9
- Dollar Input fixed to 2 decimal points HOT 3
- Better kobalte RadioGroup example attached here; fixes bug HOT 1
- [solidjs] How to use createResource or createAsync to load default values HOT 5
- [solidjs] Conditional validation
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from modular-forms.