This widget contains all the forms used on the page. It exposes the scope of the form.
By using this widget, we can simply create a form in ms.forms entity and use the form in the template by the same name we created the form in the entity.
ms-success | It is an attribute which is used to perform an action after the form like redirection on other page after form submission is submitted. |
---|---|
buttonname | In this we have to give the button name e.g login, submit. If button name is not defined, then by default value of button is submit. |
formname | It contains the form name whch is to be used on the current and that form should be there in ms.forms entity. |
fields | It is an array which contains the fields of the form.
| ||||||||
---|---|---|---|---|---|---|---|---|---|
formData | It is an object which contain the data of the form. | ||||||||
errors | It contains the error for the corresponding field. |
submit() | This function is used to check the validity of the form. If errors, then form will not be submitted. |
---|
<ms-form form="abc" @success="ms.goTo('/')">
<div v-if="!loading">
<w-form-layout :form="form"></w-form-layout>
</div>
</ms-form>
<div ms-widget="ms.forms" ms-data-formname="abc" ms-data-buttonname="Submit" ms-success= "ms.location.path('/')">
<form name="abc" ng-submit="submit()">
<div ms-widget="ms.th3.form_layout1"></div>
</form>
</div>