Disable the ability to have leading and proceeding white spaces within inputs

Would it be possible to have the ability to disable white spaces from being added to the beginning and end of inputs? My reasoning behind this feature is that I’ve been running into an issue with a Toolset I’ve built for my support team that provides them backend ability with Active Directory such as group lookup, group adding, creating file directories for home drives, etc… just normal everyday IT support tasks. But the issue I’m running into consistently is the ability to have white spaces in the leading and proceeding of inputs and forms. Which cause most of my tools to error out. Now I can normally catch it really quickly because of the logging features I’ve built in but it’s just an annoying detail I’d like to be able to disable if possible without having to build a hardcoded check into each endpoint.

Hi @aggiebeckett yep this is possible…thinking either the validation method on input, example here:- https://github.com/ironmansoftware/universal-dashboard/blob/master/src/UniversalDashboard.UITest/Integration/Input.Tests.ps1#L46
and here:-
The above example is a dashboard I used to input the validation. If you look at the code I am using on the New Vehicle input you will see I also output the information entered to a file, so I can adjust the file to get in SQL format…Which then leads me to idea 2. Which is to output the input to a txt file, then do a get-content and strip the start and end whitespace, and pass that as the command for AD or something. I hope that makes sense? Or option 3 use drop-downs? Hopefully this inspires you to a solution :smiley:


Ahh i see thats a pretty good solution and should be quite easy to replicate. I’ll see what I can work up thanks for the inspiration!

1 Like