Multi-Step Input

You can replicate a multi-step input form by nested UD inputs. The first UDInput will return another UDInput and the final endpoint will use variables form the first two inputs.

$Dashboard = New-UDDashboard -Title "Nested Inputs" -Content {
    New-UDInput -Endpoint {
        param($FirstName)

        New-UDInputAction -Content {
            New-UDInput -Endpoint { 
                param($Lastname)

                New-UDInputAction -Content {
                    New-UDHeading -Text "$FirstName $LastName"
                }
            } -SubmitText "Finish"
        }
    } -SubmitText "Next"
}

Start-UDDashboard -Dashboard $Dashboard -Port 10001 -Force
5 Likes

Damn that was easier than I thought it would be…I was even looking at a stepper component to achieve this same functionality nice job thanks for sharing :+1:

1 Like

This is very helpful… now i can stop my teachers writing novels for the reason they gave a kid detention and provide them with a list instead…

1 Like

Dude you seen my multi select component? https://marketplace.universaldashboard.io/Dashboard/UniversalDashboard.UDSelector you could give your teachers predefined selections, and let them click away all the reasons :smiley: