Class: FormView

FormView()

A FormView is data fields to bind input, select or textarea by theirs names.

Constructor

new FormView()

Source:
Examples
// Create a FormView bound to loginForm
views.form = new FormView('loginForm');

evts.form_submit = function(sender, e) {
  var body = this.data;
  http.post('/login', { body });
}
{@lang xml}
<form id="loginForm">
  <input type="text" name="email">
  <input type="password" name="password">
  <button type="submit">Sign in</button>
</form>

Members

data

Source:

data

Source:

Methods

findEl()

also returns form element by name.
Source:

findEl()

also returns form element by name.
Source:

getValueOf(field) → {Any}

Get field value as the type.
Parameters:
Name Type Description
field string target field
Source:
Returns:
the value
Type
Any

getValueOf(field) → {Any}

Get field value as the type.
Parameters:
Name Type Description
field string target field
Source:
Returns:
the value
Type
Any

FormView()

A FormView is data fields to bind input, select or textarea by theirs names.

Constructor

new FormView()

Source:
Examples
// Create a FormView bound to loginForm
views.form = new FormView('loginForm');

evts.form_submit = function(sender, e) {
  var body = this.data;
  http.post('/login', { body });
}
{@lang xml}
<form id="loginForm">
  <input type="text" name="email">
  <input type="password" name="password">
  <button type="submit">Sign in</button>
</form>

Members

data

Source:

data

Source:

Methods

findEl()

also returns form element by name.
Source:

findEl()

also returns form element by name.
Source:

getValueOf(field) → {Any}

Get field value as the type.
Parameters:
Name Type Description
field string target field
Source:
Returns:
the value
Type
Any

getValueOf(field) → {Any}

Get field value as the type.
Parameters:
Name Type Description
field string target field
Source:
Returns:
the value
Type
Any