Extending Forms
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
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