-
-
Notifications
You must be signed in to change notification settings - Fork 2.8k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
New Examples / Sandboxes #1315
Comments
I can handle checboxes if that's ok. But a couple of questions. Could we get a little more explanations regarding the other 3. What is the requirements. If you can provide more scenarios I would be happy to help... |
I made a sandbox for #1205. Let me know if there's anything to improve / if we should move it into an example. I believe that issue was talking about two selects which are always shown where choosing an option in the first select changes what options are available in the second select. If desired, I can make another sandbox where a select's selected value will hide/show another field. |
I created two examples for masked inputs.
|
@jamesmosier your solution working for me. Thanks |
A multi-select example would be incredibly helpful as well. Additionally, I've been hitting issues trying to get a |
Started work on these, will provide WIP soon |
While working on examples and with Docusaurus... It is kinda limiting but hard to imagine managing docs versioning on our own. Any plans here? Is there something better? Edit |
WIP and preview here https://festive-wozniak-c71293.netlify.com |
cc @demkovych - I just added radio boxes example with "check all" functionality |
@Andreyco are there any working sandboxes floating around with current formik versions that implement radio checkbox group? |
+1 on this question |
Auto save form example #1506: |
I created a FormWizard that uses Yup and Hooks. Might be useful for someone here
And how a basic example of how to use it
|
#1035 has been closed even though it's not a duplicate nor resolved here, even with examples (docs would be better). |
Here is a simple example for a set/group of radio buttons: https://codesandbox.io/s/formik-radio-button-group-example-d6l33 |
I wrote an example using Reactstrap (UI library) with Yup + Formik, demonstrating all the important features for a wizard. Uses class components https://github.com/vincentntang/multistep-wizard-formik-yup-reactstrap |
You did a great job. Thank you so much for your demo with radio button |
Here's an updated Multistep Wizard that uses hooks, and Yup: https://codesandbox.io/s/formik-multistep-wizard-5bkkl?file=/index.js (Evolved from @schrapel's example, updated for Formik 2.x, removed Formik internals, made more extensible, etc) |
Some examples with fetch or http requests on submit would be helpful. |
@BenjDG there is nothing special about fetch or http requests on submit, so documenting is a little out of scope. We do document that onSubmit can be async. Here's a fetch request and associated documentation: <Formik
onSubmit={async (values) => {
const response = await fetch(endpointUrl, {
method: 'POST',
headers: {
'Content-Type': 'application/json'
// 'Content-Type': 'application/x-www-form-urlencoded',
},
body: JSON.stringify(values), // or build a new FormData() for x-www-form-urlencoded
});
const result = response.json();
console.log(result); // your API's response as an object
}}
/> |
I think some of the links in the Tutorial section point to the wrong code sandbox and it was throwing me off a bit. Thanks for your help! |
@BenjDG do you know which ones? it'd be great to note them down to fix them. glad I could help! |
At this url - https://jaredpalmer.com/formik/docs/tutorial “You can see what we'll be building here: Final Result. “ - this links to https://codesandbox.io/s/formik-v2-tutorial-final-bq0li (when you test the form, it doesn’t work. Also, it has “lol” in the code. |
Thanks! That should have been fixed in #2484. Guess it hasn't made it to the site yet? |
Does anyone have an example of storing any edits made to initialValues in a separate object? Essentially this "edited" object would only store properties that differ from their respective value in initialValues. I guess this would also contain newly added or deleted values as well. |
Is there an example of selecting all checkboxes? |
I haven't really found an example of selecting all checkboxes, so https://codesandbox.io/s/select-all-formik-lny9l this is what I have been using. Any other solution is always welcome. |
@patspam |
would love to see something official for managing multistep forms |
Is issue #1386 still unsolved? help needed |
Going through a lot of issues yesterday, I think it would be great to add some new sandboxes/examples:
Nice to have
The text was updated successfully, but these errors were encountered: