Documentation > CMS Template API Library > PostInputContext > InputForm

InputForm

Gives access to the data from the posted input form so the data can be read or modified before saving.

Type

CrownPeak.CMSAPI.InputForm

Code Example

C#

Sample:
 
             
             
             // Gets the value of a form field called "title" that was posted from the input form (input.aspx)
             string newTitle = context.InputForm["title"];
             
             // Change data to be saved
             context.InputForm["title"] = "A new value to be saved as a content property called title on the current asset";
            
             // add a value to be saved
             context.InputForm["newfield"] = "A new field to be saved as a content property on the current asset";
            
             // Does the form contain a value for a field called "fieldName"
             bool containsField = context.InputForm.HasField("fieldName");
            
            

Connect with Crownpeak