Extending Forms

Posted by Community Admin on 04-Aug-2018 13:19

Extending Forms

All Replies

Posted by Community Admin on 10-Nov-2011 00:00

Hello,

I am writing to ask if something is possible. I would like to extend the forms functionality by adding a field, which I guess would be part of the form response, to all forms that would only show in the backend. Therefore it would not show on the front end and only backend users could edit this response field value. Is this something that is even possible? If so could you point me in the right direction to get started in implementing such a feature?

Thank you

Posted by Community Admin on 15-Nov-2011 00:00

Hi Matthew,

Yes, it is possible. For a text box for example:
Create a class that inherits from:

Telerik.Sitefinity.Modules.Forms.Web.UI.Fields.FormTextBox

Then override the Visible property and put this code:
public override bool Visible
       
            get
           
                if (this.IsBackend() || this.IsDesignMode())
               
                    return base.Visible;
               
                else
               
                    return false;
               
                
           
            set
           
                base.Visible = value;
           
       


Here IsBackend() and IsDesignMode() are extension methods in ControlExtensions. First will return true when a control is rendered in the backend of Sitefinity and the 2nd will return true if the control rendered while editing the form.

All the best,
Pavel Iliev
the Telerik team

Do you want to have your say in the Sitefinity development roadmap? Do you want to know when a feature you requested is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items

This thread is closed