Automatically close form

Discussions about Forms Designer for SharePoint 2010.
Posts: 3
Joined: Thu Apr 20, 2017

20 Apr 2017

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,


User avatar
Dmitry Kozlov
Site Admin
Posts: 1524
Joined: Thu Jun 07, 2012

20 Apr 2017

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';

Posts: 3
Joined: Thu Apr 20, 2017

20 Apr 2017

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 ?

Posts: 3
Joined: Thu Apr 20, 2017

20 Apr 2017

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 !

Posts: 1
Joined: Mon Jun 05, 2017

05 Jun 2017

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

  • Information
  • Who is online

    Users browsing this forum: No registered users and 2 guests