|
1 | 1 | # API
|
2 | 2 |
|
3 |
| -- [Formsy.defaults - DEPRECATED](#formsydefaults) |
4 | 3 | - [Formsy.Form](#formsyform)
|
5 | 4 | - [className](#classname)
|
6 | 5 | - [mapping](#mapping)
|
|
24 | 23 | - [required](#required)
|
25 | 24 | - [getValue()](#getvalue)
|
26 | 25 | - [setValue()](#setvalue)
|
27 |
| - - [hasValue() - DEPRECATED](#hasvalue) |
28 | 26 | - [resetValue()](#resetvalue)
|
29 | 27 | - [getErrorMessage()](#geterrormessage)
|
30 | 28 | - [isValid()](#isvalid)
|
|
42 | 40 | - [Formsy.addValidationRule](#formsyaddvalidationrule)
|
43 | 41 | - [Validators](#validators)
|
44 | 42 |
|
45 |
| -### <a name="formsydefaults">Formsy.defaults(options) - DEPRECATED</a> |
46 |
| - |
47 | 43 | ### <a name="formsyform">Formsy.Form</a>
|
48 | 44 |
|
49 | 45 | #### <a name="classname">className</a>
|
@@ -322,25 +318,6 @@ var MyInput = React.createClass({
|
322 | 318 | ```
|
323 | 319 | Sets the value of your form input component. Notice that it does not have to be a text input. Anything can set a value on the component. Think calendars, checkboxes, autocomplete stuff etc. Running this method will trigger a **setState()** on the component and do a render.
|
324 | 320 |
|
325 |
| -#### <a name="hasvalue">hasValue() - DEPRECATED</a> |
326 |
| -```jsx |
327 |
| -var MyInput = React.createClass({ |
328 |
| - mixins: [Formsy.Mixin], |
329 |
| - changeValue: function (event) { |
330 |
| - this.setValue(event.currentTarget.value); |
331 |
| - }, |
332 |
| - render: function () { |
333 |
| - return ( |
334 |
| - <div> |
335 |
| - <input type="text" onChange={this.changeValue} value={this.getValue()}/> |
336 |
| - {this.hasValue() ? 'There is a value here' : 'No value entered yet'} |
337 |
| - </div> |
338 |
| - ); |
339 |
| - } |
340 |
| -}); |
341 |
| -``` |
342 |
| -The hasValue() method helps you identify if there actually is a value or not. The only invalid value in Formsy is an empty string, "". All other values are valid as they could be something you want to send to the server. F.ex. the number zero (0), or false. |
343 |
| - |
344 | 321 | #### <a name="resetvalue">resetValue()</a>
|
345 | 322 | ```jsx
|
346 | 323 | var MyInput = React.createClass({
|
@@ -763,7 +740,8 @@ Returns true if the value length is the equal.
|
763 | 740 | ```jsx
|
764 | 741 | <MyInputComponent name="number" validations="minLength:1"/>
|
765 | 742 | ```
|
766 |
| -Return true if the value is more or equal to argument |
| 743 | +Return true if the value is more or equal to argument. |
| 744 | +**Also returns true for an empty value.** If you want to get false, then you should use [`required`](#required) additionally. |
767 | 745 |
|
768 | 746 | **maxLength:length**
|
769 | 747 | ```jsx
|
|
0 commit comments