4.0.4 • Published 1 year ago

ct-form v4.0.4

Weekly downloads
3
License
-
Repository
-
Last release
1 year ago

form (upgrade)

In order for this plugin to work in older browsers, includ webcomponents.js plugin   https://github.com/webcomponents/webcomponentsjs

How to use it

1. Include js file in footer of the page

<script src="build/ct-form.min.js"></script>

2. Using in html

<form is="ct-form" name="example">
  <input type="text" name="name"/>
  <input type="email" name="email"/>
</form>

3. Access

// using global access: form + [name]
// when form name="example"
formExample.method();

Methods

  • toJson() - get data from all children inputs
  • toFormData() - get data from all children inputs, used formData for files
  • clear() - Clear all children inputs
  • get() - get value from one input by name
  • add() - add key to data, not change input

Attributes

  • is="ct-form" - for using modificator -required
  • data-id - must be unique in one page -required
4.0.4

1 year ago

4.0.1

1 year ago

4.0.0

1 year ago

4.0.3

1 year ago

1.0.2

7 years ago

1.0.1

7 years ago

1.0.0

7 years ago