Skip to content

Commit

Permalink
[update] examples for getText() of form input
Browse files Browse the repository at this point in the history
  • Loading branch information
mafanya23 committed Dec 12, 2024
1 parent 5d7128a commit 68328bd
Show file tree
Hide file tree
Showing 3 changed files with 21 additions and 6 deletions.
9 changes: 7 additions & 2 deletions docs/form/api/input/input_gettext_method.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,13 @@ description: You can explore the getText method of the Input control of Form in
A string with the text with the applied mask

@example:
const value = form.getItem("input").getText();
// -> "100000.01"
const input = form.getItem("input");
input.setValue(1000.01);

input.getValue(); // 1000.01 for the input type number
input.getValue(); // "1000.01" for the input type string

input.getText(); // "1,000.01" with the applied numberMask/patternMask

@descr:
The method is used with the [`numberMask`](form/work_with_form.md#numbermask) and [`patternMask`](form/work_with_form.md#patternmask) properties of the Input control. It allows getting the value with the applied mask.
Expand Down
9 changes: 7 additions & 2 deletions docs/form/api/textarea/textarea_gettext_method.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,13 @@ description: You can explore the getText method of the Textarea control of Form
A string with the text with the applied mask

@example:
const value = form.getItem("textarea").getText();
// -> "100000.01"
const input = form.getItem("textarea");
input.setValue(1000.01);

input.getValue(); // 1000.01 for the input type number
input.getValue(); // "1000.01" for the input type string

input.getText(); // "1,000.01" with the applied numberMask/patternMask

@descr:
The method is used with the [`numberMask`](form/work_with_form.md#numbermask) and [`patternMask`](form/work_with_form.md#patternmask) properties of the Textarea control. It allows getting the value with the applied mask.
Expand Down
9 changes: 7 additions & 2 deletions docs/form/work_with_form.md
Original file line number Diff line number Diff line change
Expand Up @@ -325,8 +325,13 @@ When you need to get the value of an input or a textarea with the applied mask,
It returns the input value of the control as a string. The method is used with the `numberMask` and `patternMask` properties of the control.

~~~jsx
const value = form.getItem("input").getText();
// -> "100000.01"
const input = form.getItem("input");
input.setValue(1000.01);

input.getValue(); // 1000.01 for the input type number
input.getValue(); // "1000.01" for the input type string

input.getText(); // "1,000.01" with the applied numberMask/patternMask
~~~

## Validating form
Expand Down

0 comments on commit 68328bd

Please sign in to comment.