Hong
May 25, 2021, 1:02pm
1
I have a button
New-UDButton -Text ‘Anwenden’ -OnClick {
…
}
It seems quite simple but I don´t find an example how to add a user comfirmation like this in javascript before going on
if (confirm(“Go”)) {
…
} else {
…
}
Any help would be appreciated.
adam
May 25, 2021, 2:02pm
2
We don’t have a component for this specifically but you could use the modal to accomplish it.
New-UDButton -Text "Do Something" -OnClick {
Show-UDModal -Content {
New-UDTypography -Text "Are you sure you want to do this?"
} -Footer {
New-UDButton -Text "Yes" -OnClick {
Show-UDToast "You did it!"
Hide-UDModal
}
New-UDButton -Text "No" -OnClick { Hide-UDModal }
} -Persistent
}
2 Likes
Hong
May 26, 2021, 11:29am
3
@Adam , Thank you a lot for the quick help!