diff --git a/API.md b/API.md index d537df0..c286a43 100644 --- a/API.md +++ b/API.md @@ -1,6 +1,5 @@ # API -- [Formsy.defaults - DEPRECATED](#formsydefaults) - [Formsy.Form](#formsyform) - [className](#classname) - [mapping](#mapping) @@ -24,7 +23,6 @@ - [required](#required) - [getValue()](#getvalue) - [setValue()](#setvalue) - - [hasValue() - DEPRECATED](#hasvalue) - [resetValue()](#resetvalue) - [getErrorMessage()](#geterrormessage) - [isValid()](#isvalid) @@ -42,8 +40,6 @@ - [Formsy.addValidationRule](#formsyaddvalidationrule) - [Validators](#validators) -### Formsy.defaults(options) - DEPRECATED - ### Formsy.Form #### className @@ -322,25 +318,6 @@ var MyInput = React.createClass({ ``` 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. -#### hasValue() - DEPRECATED -```jsx -var MyInput = React.createClass({ - mixins: [Formsy.Mixin], - changeValue: function (event) { - this.setValue(event.currentTarget.value); - }, - render: function () { - return ( -
- - {this.hasValue() ? 'There is a value here' : 'No value entered yet'} -
- ); - } -}); -``` -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. - #### resetValue() ```jsx var MyInput = React.createClass({ @@ -763,7 +740,8 @@ Returns true if the value length is the equal. ```jsx ``` -Return true if the value is more or equal to argument +Return true if the value is more or equal to argument. +**Also returns true for an empty value.** If you want to get false, then you should use [`required`](#required) additionally. **maxLength:length** ```jsx