Input Form Customization - Submit button

Good morning All,

I was looking through the change log for 2.3.0, and I noticed for the Page control, there is now support to customize the style of the “submit” button on a form. Does anyone know if this capability exists for a form on a dashboard as well? If so, does anyone have an example of how that might be done? I tried looking in the documentation for that, and did not see anything for that, but its possible that I missed something! I appreciate any insight that you guys might have on this!

Thank you,

Evan Costa

Product: PowerShell Universal
Version: 2.3.0

You can use the -SubmitText parameter of New-UDForm to change the text. You can use -ButtonVariant to change the style of the button.

        [ValidateSet('text', 'contained', 'outlined')]
        [string]$ButtonVariant = 'text',

Hey Adam,

Awesome! that worked perfectly! thanks again for the help!

@adamdriscoll - is there a way to edit the color and background color of the form submit button?

You could use UDStyle to do this.

New-UDStyle -Style ".MuiButton-root { color: red !important; background: blue !important }" -Content {
      New-UDForm -Content {} -OnSubmit {}
}
    

image

Is there a way to disable the submit button after OnSubmit?

Currently, not supported but you could return a new component from the form so it’s not shown any more.

 New-UDForm -Content {} -OnSubmit { 
    # Do some form submitting
    New-UDElement -Tag div 
}