Skip to content
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

[Question] Conditional Fields #372

Closed
noxify opened this issue Jan 19, 2017 · 3 comments
Closed

[Question] Conditional Fields #372

noxify opened this issue Jan 19, 2017 · 3 comments

Comments

@noxify
Copy link

noxify commented Jan 19, 2017

Hi,

currently i have two fields, type and parent, the parent field is only required even when the type has the value X. If the value is Y or Z, then the field is not required.

I know, i can add a condition in the setupmethod. But then I have to save the record.

Has someone an idea how to solve this?

Thanks!

@OwenMelbz
Copy link
Contributor

When you create your crud controller, it will generate a Request along with it.

That stores your validation - this is just a normal laravel feature which you can read about https://laravel.com/docs/5.3/validation#creating-form-requests

So just add your custom validation in there.

I'm just gonna close this issue now as it's a support request rather than a package issue. Feel free to continue using it though

@OwenMelbz
Copy link
Contributor

Oh right, yeah you can do it using javascript and your own custom field.

Theres a PR for something which may be similar #165

@noxify
Copy link
Author

noxify commented Jan 19, 2017

Awesome thanks :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants