Basic #
This is the most basic usage of RegateTextarea.
Regate.RegateTextarea.init({
id: 'basic-example',
name: 'Title',
})Value #
With value property you can set an initial value for your textbox.
Regate.RegateTextarea.init({
id: 'value-example',
name: 'Title',
value: 'Hello World',
})Required #
You can required your field with isRequired property.
Regate.RegateTextarea.init({
id: 'required-example',
name: 'Title',
isRequired: true,
})Placeholder #
You can set the placeholder of textbox with placeholder property.
Regate.RegateTextarea.init({
id: 'placeholder-example',
name: 'Title',
placeholder: 'Please enter title',
})Size #
With the size property you can define the height of textarea.
Accepted values are available in
RegateTextarea.Size object.
Regate.RegateTextarea.init({
id: 'size-example',
name: 'Title',
size: Regate.RegateTextarea.Size.Small,
})onChange #
With onChange event you can get value of textbox on every user interaction with textbox.
Originally, Regate will bind this event to the oninput event of textbox.
Regate.RegateTextarea.init({
id: 'onchange-example',
name: 'Title',
onChange: function ({value, isValid}) {
console.log(value, isValid)
}
})onInitialized #
The onInitialized event is called once when the RegateTextarea is initialized successfully.
You have access to the value of textbox.
Regate.RegateTextarea.init({
id: 'oninitialized-example',
name: 'Title',
value: 'Hello World',
onInitialized: function ({value, isValid}) {
console.log(value, isValid)
}
})