conditional-fields | Craft plugin to only use fields | Content Management System library
kandi X-RAY | conditional-fields Summary
kandi X-RAY | conditional-fields Summary
Show or hide fields or tabs of fields based on the value of other fields. PRs gratefully received. Easy now, this is probably not all you hoped it would be when you saw it was released! That said, please post any issues you're having and I'll check them out. Conditional field layouts are coming to Craft CMS version 4 core. ~~Craft CMS version 2 had the Reasons plugin but there's nothing working for Craft 3 at the moment.~~. This is a very simple, very dumb, implementation of a way to get conditional field layouts in your entries etc. If you need something complex it's almost certainly not possible with this plugin, but if you just need to show and hide some fields based on simple selections, like light switches, give it a whirl.
Support
Quality
Security
License
Reuse
Top functions reviewed by kandi - BETA
- Get the html for this field
- Render the field settings
- Returns the validation rules .
- Initializes the component .
- Get field display name .
- Returns the content column type .
conditional-fields Key Features
conditional-fields Examples and Code Snippets
Community Discussions
Trending Discussions on conditional-fields
QUESTION
Here is my form looks like and also CodeSanbox. currently I'm using react-hook-form
as you can see form has 3 inputs. Submit button should be disabled until all the required fields are entered.
Two use case:
- If "Check" is unchecked:
- only "id" should be validated and submit button should get enabled. "firt" and "last" names should not be part of form data
- If "Check" is checked
- all the fields should be validated
first and last names are only required if "Check" is checked. so its not checked then form should only validate "ID" field. if "Check" is checked then all fields should get validated.
- all the fields should be validated
problem I'm having is if I enter id, form state is still "invalid". Form is expecting to enter values for first and last name.
I would appreciate any help.
ANSWER
Answered 2020-Dec-11 at 20:09on your ref, dont use hard coded bool true
, ref={register({ required: true})}
, but your dynamic ref={register({ required: disabled })}
do notice that because your mode: "onBlur"
config, the button won't be abled until id
field blurred
QUESTION
What I mean by "Leaking" is the following. I have an About.vue with its own styling (About.scss) and it's own endpoint "/about". I also have the home page endpoint "/" and its corresponding Laravel blade template (Index.blade.php) with its own styling (Index.scss).
The Problem
The style from About.scss is affecting the Index.scss, and they're not even in the same html file that's returned by the server. And it's like this for my entire website. Everything was completely fine before I updated to Laravel Mix ^5.*.
composer.json
...ANSWER
Answered 2020-Nov-05 at 16:56Well, I just had to bite the bullet and convert ALL of my styles to "scoped," scanning all pages on my web site to fix any breaking changes. It sucked, but so far I think I found all the styling issues and was able to fix them.
I have a feeling that Laravel-Mix ^5.0 compiles its assets a little differently compared to previous versions. That'd be my best guess.
QUESTION
I've set up some conditional fields as per https://github.com/final-form/react-final-form#conditional-fields
The form is complex and uses components that are used elsewhere. These components have validators built in so they are consistent across the application. If the fields get hidden but they have a validator, the form cannot be submitted.
How can I get around this?
...ANSWER
Answered 2019-Mar-30 at 05:52Fair comments folks, it must've been late in the evening when I posted this.
MCVE example https://codesandbox.io/s/ymw0nvjy2j turns out to work fine, so must be something weird I've done in my app
Community Discussions, Code Snippets contain sources that include Stack Exchange Network
Vulnerabilities
No vulnerabilities reported
Install conditional-fields
Open your terminal and go to your Craft project: cd /path/to/project
Then tell Composer to load the plugin: composer require billythekid/conditional-fields
In the Control Panel, go to Settings → Plugins and click the “Install” button for Conditional Fields.
Support
Reuse Trending Solutions
Find, review, and download reusable Libraries, Code Snippets, Cloud APIs from over 650 million Knowledge Items
Find more librariesStay Updated
Subscribe to our newsletter for trending solutions and developer bootcamps
Share this Page