I think the problem with visibility as opposed to display, is display will actually shuffle the elements to take up the space of the now hidden element, visibility doesn’t.
Would leave a big gap on my form. Thanks for the idea though.
Thanks psDevUK but since that is happening after form load it’s pretty much the same as how i have it working now with Invoke-UDJavascript.
I also don’t know if I could set the value of the drop-down via that method since it seems to convert to a list with about a dozen classes on run.
I think I could do it if I could get the scripts parameter back from New-UDDashboard in v2.
I might try to edit the client HTML and add my scripts there. Was hoping for an official answer from Adam though on how we are really supposed to add scripts in Universal now.
I figured out how to do it. Yay, sharing it here in case it helps anyone else.
Install UDStyle because it is needed for this to work
Wrap the element you want to hide like so:
New-UDStyle -Style 'display:none;' -Content {
#content you want to hide
New-UDCard -id 'myID' -Content {
}
#end hidden content
}
Now, normally we’d use the “ID” of our UDStyle element but that doesn’t seem to work, no matter what I specify for “ID” it doesn’t actually get rendered in the HTML so instead we do like this:
@BenevolentD just wanted to say a big thanks for this. You’ve got me out of a right pickle with this! Using text boxes dynamically with switches and set-udelement just doesn’t seem to work no matter what way I tried it I always got odd behaviour. This worked perfectly though so thanks!