Form
This page details the actions available to Forms.
Reset
If at any point you need to reset a form, you can use Reset-PodeWebForm which will clear all elements of the specified form:
New-PodeWebCard -Content @(
New-PodeWebForm -Name 'Example' -ScriptBlock {} -Content @(
New-PodeWebTextbox -Name 'Name'
New-PodeWebTextbox -Name 'Password' -Type Password -PrependIcon Lock
New-PodeWebCheckbox -Name 'Checkboxes' -Options @(
'Terms', 'Privacy' | ConvertTo-PodeWebOption
) -AsSwitch
New-PodeWebSelect -Name 'Role' -Multiple -Options @(
'User', 'Admin', 'Operations' | ConvertTo-PodeWebOption
)
)
)
New-PodeWebContainer -NoBackground -Content @(
New-PodeWebButton -Name 'Reset Form' -ScriptBlock {
Reset-PodeWebForm -Name 'Example'
}
)
Submit
You can adhoc submit a form by using Submit-PodeWebForm:
New-PodeWebCard -Content @(
New-PodeWebForm -Name 'Example' -ScriptBlock {} -Content @(
New-PodeWebTextbox -Name 'Name'
New-PodeWebTextbox -Name 'Password' -Type Password -PrependIcon Lock
New-PodeWebCheckbox -Name 'Checkboxes' -Options @(
'Terms', 'Privacy' | ConvertTo-PodeWebOption
) -AsSwitch
New-PodeWebSelect -Name 'Role' -Multiple -Options @(
'User', 'Admin', 'Operations' | ConvertTo-PodeWebOption
)
)
)
New-PodeWebContainer -NoBackground -Content @(
New-PodeWebButton -Name 'Submit Form' -ScriptBlock {
Submit-PodeWebForm -Name 'Example'
}
)