You are correct, the conditional logic should happen when you're clicking an option, not on submission of the form.
@* Includes stylesheets necessary for page builder functionality *@
@* Includes scripts necessary for page builder functionality *@
There is an example of this on the tutorial area here.
However, if you don't want to include all of the pagebuilder script, and you specifically want just the form updating code, you could add an MVC bundle that includes the following JS:
You can do this by adding/editing the BundleConfig.cs and adding:
/// Bundle configuration for application.
public class BundleConfig
/// Register bundles to given <paramref name="bundles"/> collection.
public static void RegisterBundles(BundleCollection bundles)
private static void RegisterCustomFormBuilderBundle(BundleCollection bundles)
var bundle = new ScriptBundle("~/bundles/updatableFormHelper")
and then in the layout file, you can reference the bundle: