Page 1 of 1

Automatically close form

Posted: 20 Apr 2017
by rohstev
Hi all,

I've a form with 3 groups. One group ("noAccess") represents users who don't have right to fill the form. As the link "new item" is on a public Intranet page, I can't simply hide this link.
My idea is to show an alert message to the user who click the "new item" link and who is member of the group "noAccess".
For this group, I set a blank form and in the javascript code I wrote :

Code: Select all

1. Alert("You are not allowed to fill this form.");
2. ??? --> How to close the form automatically ?
Thanks for your help & regards,

Steve

Re: Automatically close form

Posted: 20 Apr 2017
by Dmitry Kozlov
Do you open the form in a dialog and want to close the dialog after showing the message? If not, just redirect users to another page by using the code:
window.location = 'URL to another page';

Re: Automatically close form

Posted: 20 Apr 2017
by rohstev
Hi Dmitry,
Thanks for your reply but this doesn't work... The blank form is still displayed without redirection.

An other idea... Would it be possible to show the form with a unique text message (eg "You are not allowed to fill this form.") and a single button "OK" ? Or is it possible to hide the "Save" button and display only the "Cancel" one ?

Re: Automatically close form

Posted: 20 Apr 2017
by rohstev
I've found a solution.
Instead of using an alert message, I simply use a blank formular with a simple text message and deleted the "Save" button.

Problem solved !

Re: Automatically close form

Posted: 05 Jun 2017
by romstr
Hi Rohstev,
this looks exactly is function, which I am looking for :-).
Could you please share the script with us? I am quite beginner with scripting, so looking for, how to initiate the check and also how to hide / remove the button, if user is not authorized?

Thank you very much