Creating a Form in Sitefinity .NET Core

.net core - creating a form - form on a dashboard Written By Jake Picken

Creating a form in .NET is easy, intuitive, and allows marketers to create several variations of forms to capture leads on their website. 

In this video, we will show you how to build a form and what the new .NET Core form building experience looks like in Sitefinity.

 

 

 

In this Sitefinity Minute, we are going to show you how to create a form in .NET CORE. 

So, from the forms page, you will go to Create a Form

First, we will go ahead and name our form. 

And then once the new .net core form builder is enabled in Sitefinity, under the advanced section here you will see the option to choose .NET Core as a web framework. 

We are going to choose .NET Core and then click on create and go to add fields. 

The next screen you are going to land on is the .NET Core form builder. 

And instead of dragging and dropping widgets onto the page, like you did when building forms in MVC, you are just going to click on where it says Add widget here to add your widgets to the form. 

And then you will get this screen that has all of your form widgets listed in categories.  

So, let’s start building this form.  We’ll first add a textbox widget and once this is added we can then go and edit the field. 

Under the field called label is where we name the field. So, the first thing we want to capture in this form is the user's first name.  So, you can add instructional text if you want. 

This next option for this textbox form widget is to define the field type.  So here from the drop-down you can see which options you have to choose from. Since we are capturing the first name we are going to choose the text option. 

So we are going to go ahead and make this field required.  And you also have the option to hide the field here. 

Now I am going to go ahead and change the copy here so this error message makes a little more sense to our users. 

So, this next section here is called limitations so you can do things like limit the amount of characters someone types into this field. 

Here you have the option to set the field size. We are just going to make it medium. 

We’ll go ahead and save it and then add the other widgets. 

So we are going to add a field for the last name with all the same field settings we did for the first name. 

And then we’ll add an email field. The only difference here is for the field type, we are going to select email and all the other settings are going to be the same. 

We’ll then add a paragraph widget. 

For this field, we are going to limit the number of characters someone can type in. 

And we are going to go ahead and add the submit button to our form. 

Now, once added to your form, you can go and change what the button text says. And we are just going to make it all caps. 

So, let’s go ahead and publish the form, and now it is ready to add to a page. 

And that’s the Sitefinity Minute.