Virtual Happy Hour this month, Jun 28, we'll be getting a sneak preview at our soon to launch SaaS CMS!

Try our conversational search powered by Generative AI!

Hide XForm when it can't be submitted without logging in

Vote:
 

Hi:

When creating a new XForm and selecting the option to just submitt the XForm when the user is logged in, the form cannot be submitted but still appears on the website. I would like the form to appear always when this option is not selected, but when one just want the form to be submitted when the user is logged in, then I would like the form to be displayed only if the user is logged in. Any ideas how can I detect if this function is selected or not?

Thanks

#51861
Jun 27, 2011 9:53
Vote:
 
if (!Form.AllowAnonymousPost && !Page.User.Identity.IsAuthenticated)
     this.Visible = false;
    
#51863
Jun 27, 2011 10:13
Vote:
 

Thanks for the reply Andres. Already implemented it and worked perfect. Cheers

#51868
Jun 27, 2011 13:56
Vote:
 
#51873
Edited, Jun 27, 2011 15:17
This thread is locked and should be used for reference only. Please use the Episerver CMS 7 and earlier versions forum to open new discussions.
* You are NOT allowed to include any hyperlinks in the post because your account hasn't associated to your company. User profile should be updated.