I’d like to know how people are handling form confirmation or checking.
say for example I have a simple form to do something simple like create a mailing list
eg FORM
name:
location:
description:
owner:
[submit]
the user enters the data and clicks submit, the page then checks the information submitted and generate names and some other attributes and would like the user to double check this data before a final submission to a script.
eg VERIFICATION
please verify the data before submitting, if it is incorrect please update the form with the correct info
name: EDBList-LOC1
Location: Loc1
description: Mailing list for EDB - owner xyz
owner: xyz
function: Eng01
Job No: 0001/Code:abc
[Finalise]
I’m guessing most people are using modals to do this, or does anyone
else have a nice solution? A stepper would be perfect but we use schema forms and dont want to change that.
One thing I have done is have the people using the form click an extra Verify button after certain steps and run the name/attribute generation then, and have it show the generated data in a separate column with a checkbox they need to click to verify again that all the information is correct.
New-UDPage -Name 'Form' -Url '/form' -Content {
New-UDForm -Content {
# Form stuff
} -SubmitText 'Preview' -ButtonVariant 'contained' -OnSubmit {
# On click of Preview button, add content to Preview element
set-UDElement -id 'preview' -content {
New-UDPaper -content {
"This is a preview"
} -Elevation 2
# Create a button to confirm preview and send data to specified email.
New-UDButton -Text 'Finalize' -OnClick {
# Finalize button has been pressed
# Submit form content to logic/script/whatever
} -Color primary -ShowLoading
}
}
# On page load, set preview element to empty
New-UDElement -Id 'preview' -Tag 'div'
}
So I’ve got the form at the top, then when submitting the form it populates the empty “Preview” element. Inside that element is another button that actually finalizes the form and submits the collected information into whatever logic is needed.
Since the original form is still visible, it can be changed and the user can click ‘Preview’ to update the paper.
If you don’t want the form still visible, I recommend looking at using a Stepper instead. That can do all the same things, however it will advance to different stages and will include a back button.