Form Builder Submit Behavior

Matthew Milliman asked on July 15, 2021 22:10

Upfront quick info:

Version: 13.0 HF 16
Dev Method: Core
Experience Level: Beginner (First Xperience Project)

I'm trying to create a "Contact Sales" form that would live within a Modal style partial view. I've created the form using the Form Builder module, but the problem I'm running into is submit behavior. When toggled on the "Display Text" option, I initially thought it would replace the HTML block where the form was found with a span containing the text. This would have worked fine, as I could then direct the user to close the modal and pick up where they left off in browsing the site. When I tested this, it redirects to a "site/Kentico.Components/en-US/Kentico.FormWidget/KenticoFormWidget/FormSubmit?formName=Talk_to_sales&prefix=form-Talk_to_sales-4300&displayValidationErrors=False" route where it displays the span.

Is there any way to configure this behavior to NOT redirect to a new page that displays the text? Redirecting to a static URL also doesn't feel great in this case, as the intention behind using a modal is to not take them out of their flow during browsing. Additionally, the "Reload Form" option has a similar behavior to the display text.

Any help on this would be greatly appreciated!!

Correct Answer

Dmitry Bastron answered on July 20, 2021 10:17

Hi Matthew,

I have noticed this behaviour when Kentico JS (including jquery and unobtrusive) wasn't included in the layout. Could you check that you have @Html.Kentico().PageBuilderScripts() in your layout? It should be always present for Form Builder to work correctly.

2 votesVote for this answer Unmark Correct answer

Recent Answers


Sean Wright answered on July 19, 2021 17:42

The form submits via XHR - you could try intercepting the form submission in JavaScript and then programatically submitting it with your code and deciding to do something else when the form submits successfully.

Since you have custom UX / HTML that you want to use, I think this will require you to write some custom code.

0 votesVote for this answer Mark as a Correct answer

Matthew Milliman answered on July 30, 2021 15:39

Hey Dmitry,

THANK YOU SO MUCH FOR YOUR ANSWER! Adding the scripts to the layout totally fixed the issue! I couldn't really find any mention of including that in the documentation surrounding the form builder, so it looks like that definitely needs to be included. I even reached out to support and they said I would need to go with a totally custom solution and not use form builder.

Again, THANK YOU! YOU ROCK!

0 votesVote for this answer Mark as a Correct answer

   Please, sign in to be able to submit a new answer.