Helpcenter +918010117117 https://cdn1.storehippo.com/s/573db3149f0d58741f0cc63b/ms.settings/5256837ccc4abf1d39000001/57614ef64256dc6851749879-480x480.png" support@storehippo.com https://www.facebook.com/StoreHippohttps://twitter.com/StoreHippohttps://www.linkedin.com/company/hippoinnovations/https://plus.google.com/+Storehippo/posts
B4,309-10 Spaze iTech Park, Sector 49, Sohna Road, 122001 Gurgaon India

ms.forms

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.


Attributes

ms-successIt is an attribute which is used to perform an action after the form like redirection on other page after form submission is submitted.
buttonnameIn 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.
formnameIt contains the form name whch is to be used on the current and that form should be there in ms.forms entity.

Variables

fields
It is an array which contains the fields of the form.
nameReturn the name of the field.
data_typeReturn the data type of the field.
labelReturn the label of the field.
settingsSettings defines various other fields and allows to assign validation over the fields.
formData
It is an object which contain the data of the form.
errors
It contains the error for the corresponding field.

Methods

submit()This function is used to check the validity of the form. If errors, then form will not be submitted.

Examples

Redirect to another page outside the website

<div ms-widget='ms.forms' class="login-form ms-fs-14" ms-data-formname="abc"
     ms-data-buttonname="Submit"   ms-success= "ms.goTo('/')">
  <form name="abc" ng-submit="submit()">
       <div ms-widget="ms.th3.form_layout1"></div>
    </form>
</div>

Redirection to static page on custom form submission

<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>