Dialog box

77 views
Skip to first unread message

Mani

unread,
Oct 20, 2020, 10:49:38 PM10/20/20
to Orbeon Forms
Hi Alex - Can a dialog box be displayed with an error message if a control validation fails and not let the user submit the form. 

Scenario
Only payroll staff (code '111') can submit a form.
If ($code != 111) then display dialog box with the error message.

if possible, can you please point me in the right direction

Thanks

Alessandro Vernet

unread,
Oct 21, 2020, 6:50:13 PM10/21/20
to orb...@googlegroups.com
Hi Manish,

Is this with a form created with Form Builder? If so, isn't this happening
by default, i.e. if a field is invalid, and users try to submit or save the
form, they will get a dialog telling them they need fix errors first, and
all errors will show in the error summary.

‑Alex

-----
--
Follow Orbeon on Twitter: @orbeon
Follow me on Twitter: @avernet
--
Sent from: http://discuss.orbeon.com/

Mani

unread,
Oct 21, 2020, 9:07:15 PM10/21/20
to Orbeon Forms
Yes it does. But the requirement is to display a dialog box as soon as the validation fails

Scenario - Display error dialog box if the submitter is not a Manager.
Example: Employee details are auto-populated based on the logged in user which includes their position (positions can be multiple in which case the submitter selects one from a drop-down). If the selected submitter position code does not match with the manager code then that should immediately dispatch/trigger a dialog box with a message 'You are not eligible to submit this form' even before clicking on save or submit button. Is this possible?

Thanks

Alessandro Vernet

unread,
Oct 22, 2020, 4:50:20 PM10/22/20
to orb...@googlegroups.com
Hi Manish,

You would have to write some XForms to do something like that. And the
XForms should go in a separate file on the server where you put your custom
model logic. You can use an `<xf:message>` action to show the message, or if
you need a custom dialog, you can also create your own custom dialog.

https://doc.orbeon.com/form-runner/advanced/custom

Mani

unread,
Jan 24, 2024, 1:28:47 AMJan 24
to Orbeon Forms
Thanks Alex - The document is too vague for someone with no xforms knowledge - is there a sample or something that I can refer to for creating a custom dialog?

Alessandro Vernet

unread,
Jan 24, 2024, 11:02:55 PMJan 24
to orb...@googlegroups.com
Hi Manish,

Yes, it can be a bit tricky. Since we have already started discussing this on Basecamp, I suggest we continue our discussion there.

-Alex

--
You received this message because you are subscribed to the Google Groups "Orbeon Forms" group.
To unsubscribe from this group and stop receiving emails from it, send an email to orbeon+un...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/orbeon/7be12740-830f-4691-ae7f-a2ebb91f4d00n%40googlegroups.com.
Reply all
Reply to author
Forward
0 new messages