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

Add -Required switch parameter to UDInputfield #1136

Open
PorreKaj opened this issue Sep 18, 2019 · 1 comment
Open

Add -Required switch parameter to UDInputfield #1136

PorreKaj opened this issue Sep 18, 2019 · 1 comment
Assignees
Labels
enhancement New feature or request

Comments

@PorreKaj
Copy link

Is your Enhancement request related to a problem? Please describe

A feature that would come in handy - The ability to specify if input in a field is required before submitting.

Describe the solution you'd like

A simple -Required switch could be added, that forces the end user to enter data in a field before submitting.
It could be complemented by a -RequiredText parameter, where one could specify a more detailed error message to be displayed, or left out to simply default to something like "required"

Describe how this would improve your Universal Dashboard Quality of Life

Required fields is a natural thing to have in a form.
Today we need to validate the inputs in the endpoints and inform the end user with toasts.
This enhancement could simplify that process.

Describe alternatives you've considered

Validating in the endpoint is the g oto method at the moment.

@PorreKaj PorreKaj added the enhancement New feature or request label Sep 18, 2019
@adamdriscoll
Copy link
Member

If you aren't using New-UDInputField, you can do this with the param block but it does make sense to do this here. I could see adding a "Validate" script block as well that would get called per field as well.

https://github.com/ironmansoftware/universal-dashboard/blob/master/src/UniversalDashboard.UITest/Integration/Input.Tests.ps1#L150

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

No branches or pull requests

3 participants