8000 Update documentation · coderabsolute/formsy-react@89a2d42 · GitHub
[go: up one dir, main page]

Skip to content

Commit 89a2d42

Browse files
author
Semigradsky
committed
Update documentation
1 parent 6767a6b commit 89a2d42

File tree

1 file changed

+2
-24
lines changed

1 file changed

+2
-24
lines changed

API.md

Lines changed: 2 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
# API
22

3-
- [Formsy.defaults - DEPRECATED](#formsydefaults)
43
- [Formsy.Form](#formsyform)
54
- [className](#classname)
65
- [mapping](#mapping)
@@ -24,7 +23,6 @@
2423
- [required](#required)
2524
- [getValue()](#getvalue)
2625
- [setValue()](#setvalue)
27-
- [hasValue() - DEPRECATED](#hasvalue)
2826
- [resetValue()](#resetvalue)
2927
- [getErrorMessage()](#geterrormessage)
3028
- [isValid()](#isvalid)
@@ -42,8 +40,6 @@
4240
- [Formsy.addValidationRule](#formsyaddvalidationrule)
4341
- [Validators](#validators)
4442

45-
### <a name="formsydefaults">Formsy.defaults(options) - DEPRECATED</a>
46-
4743
### <a name="formsyform">Formsy.Form</a>
4844

4945
#### <a name="classname">className</a>
@@ -322,25 +318,6 @@ var MyInput = React.createClass({
322318
```
323319
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.
324320

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-
344321
#### <a name="resetvalue">resetValue()</a>
345322
```jsx
346323
var MyInput = React.createClass({
@@ -763,7 +740,8 @@ Returns true if the value length is the equal.
763740
```jsx
764741
<MyInputComponent name="number" validations="minLength:1"/>
765742
```
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.
767745

768746
**maxLength:length**
769747
```jsx

0 commit comments

Comments
 (0)
0