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

Conditional required fields #910

Closed
1 task done
extravio opened this issue Oct 16, 2019 · 9 comments
Closed
1 task done

Conditional required fields #910

extravio opened this issue Oct 16, 2019 · 9 comments

Comments

@extravio
Copy link

extravio commented Oct 16, 2019

There was a pull request to implement a similar feature a year ago (require conditional fields when display rules are true).

see #770

@JessChampion it's on my todo list 😄 I'll give you some unreliable promise of a review in the next week or two if you wanted to reopen it!

Originally posted by @robbieaverill in #770 (comment)

  1. Is it still on the roadmap?
  2. Is there anything in the core that would prevent this feature from working correctly?
  3. Any guideline on how to implement such a feature as a new Field type?

Thanks.

Pull requests

@Uili-Simteau
Copy link

This is exactly the functionality we're looking for with userforms. Please update us with where this is at, and any reason why it hadn't made it in earlier?

Cheers,

Uili

@Uili-Simteau
Copy link

@robbieaverill Hope you're well? Wondering if this can be progressed do you think?

Cheers,

Uili

@maxime-rainville
Copy link

Going through original PR I think this best capture the functional requirements.

#770 (comment)

User Story

As

A CMS Administrator

I want to

Be able to create fields that are conditionally visible and be required if they are visible

So that

Visitors on my website, will have to fill out conditionally visible fields

Instead of

Currently being unable to have conditional fields validated

So that

I can enforce my website visitors to give all the answers I need

@maxime-rainville
Copy link

I'm setting the effort to easy with the assumption that we could just complete the peer review of the original PR.

@Uili-Simteau
Copy link

@maxime-rainville This sounds great, when could this be pushed through do you think? We've got 5 forms that could be impacted positively with this feature.

Cheers guys.

@maxime-rainville
Copy link

The sad truth is that we have close to 2000 issues across multiple modules. So just because something is marked as "easy" doesn't mean we'll get to it quickly.

I'll try spending an hour on it now, just to see if it's close to being in a "mergeable" state.

@maxime-rainville
Copy link

maxime-rainville commented Oct 21, 2019

I managed to do a code review. Looks pretty solid at first glance. If I get another hour somewhere, I'll try to do some functional testing.

If a few other people have the time to do some cross-browser, that might speed thing along. If you do testing, make sure you let us know what test cases you've tried and in what browsers.

@maxime-rainville
Copy link

Has been merged and should resolve the issuehttps://github.com//issues/910

It should be available in the next minor release. That's not due for another few months. If you need it right away, you can require silverstripe/user-form 5.x-dev

@Uili-Simteau
Copy link

Hey @maxime-rainville ,

I've noticed in the 5.x-dev that the description in the EditableFormField.php, line 702, still states 'Please note that conditional fields can't be required', but this pull request fixed that, and the comment should be removed to avoid confusion.

It is also in the lang/en.yml

Cheers,

Uili

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

No branches or pull requests

3 participants