@appstractdk/as-ajax-umbraco-form

2.0.7 • Public • Published

as-ajax-umbraco-form

This is a JS component that hooks to all the Umbraco Forms you have on the page and submits them with ajax. Returns and displays errors if any received form the server.

Setup:

Import the script in your Script.js

import AjaxUmbracoForm from '@appstractdk/as-ajax-umbraco-form';

The Umbraco Form container div should have a class of ".ajax-umbraco-form".

If we want for it to automatically mount we need to add the class ".automount".

Example:

<div class="form-with-sidebar-page-form-wrapper ajax-umbraco-form automount">
	@umbraco.RenderMacro("renderUmbracoForm", new { FormGuid = Model.Form, mode = "script" })
</div>

If no auto-mount is desired, we can make a new instance by using the following:

new AjaxUmbracoForm(el, successTemplate)

Options

AjaxUmbracoForm(node, successTemplate)

node - a html node
successTemplate - a html string template

Readme

Keywords

none

Package Sidebar

Install

npm i @appstractdk/as-ajax-umbraco-form

Weekly Downloads

1

Version

2.0.7

License

ISC

Unpacked Size

4.01 kB

Total Files

5

Last publish

Collaborators

  • appstract-team
  • raulstefan
  • ioanagrozav
  • mebappstract