Skip to content

Commit 68328bd

Browse files
committed
[update] examples for getText() of form input
1 parent 5d7128a commit 68328bd

File tree

3 files changed

+21
-6
lines changed

3 files changed

+21
-6
lines changed

docs/form/api/input/input_gettext_method.md

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,8 +14,13 @@ description: You can explore the getText method of the Input control of Form in
1414
A string with the text with the applied mask
1515

1616
@example:
17-
const value = form.getItem("input").getText();
18-
// -> "100000.01"
17+
const input = form.getItem("input");
18+
input.setValue(1000.01);
19+
20+
input.getValue(); // 1000.01 for the input type number
21+
input.getValue(); // "1000.01" for the input type string
22+
23+
input.getText(); // "1,000.01" with the applied numberMask/patternMask
1924

2025
@descr:
2126
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.

docs/form/api/textarea/textarea_gettext_method.md

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,8 +14,13 @@ description: You can explore the getText method of the Textarea control of Form
1414
A string with the text with the applied mask
1515

1616
@example:
17-
const value = form.getItem("textarea").getText();
18-
// -> "100000.01"
17+
const input = form.getItem("textarea");
18+
input.setValue(1000.01);
19+
20+
input.getValue(); // 1000.01 for the input type number
21+
input.getValue(); // "1000.01" for the input type string
22+
23+
input.getText(); // "1,000.01" with the applied numberMask/patternMask
1924

2025
@descr:
2126
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.

docs/form/work_with_form.md

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -325,8 +325,13 @@ When you need to get the value of an input or a textarea with the applied mask,
325325
It returns the input value of the control as a string. The method is used with the `numberMask` and `patternMask` properties of the control.
326326

327327
~~~jsx
328-
const value = form.getItem("input").getText();
329-
// -> "100000.01"
328+
const input = form.getItem("input");
329+
input.setValue(1000.01);
330+
331+
input.getValue(); // 1000.01 for the input type number
332+
input.getValue(); // "1000.01" for the input type string
333+
334+
input.getText(); // "1,000.01" with the applied numberMask/patternMask
330335
~~~
331336

332337
## Validating form

0 commit comments

Comments
 (0)