# copy textField value

**URL:** <https://forum.servoy.com/t/copy-textfield-value/19953>\
**Category:** Classic Servoy\
**Created:** [April 15, 2019, 10:21pm UTC](https://forum.servoy.com/t/copy-textfield-value/19953 "2019-04-15T22:21:34Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![tkilshaw1553613063](https://avatars.discourse-cdn.com/v4/letter/t/f08c70/32.png) [@tkilshaw1553613063](https://forum.servoy.com/u/tkilshaw1553613063)\
**Post date:** [April 15, 2019, 10:21pm UTC](https://forum.servoy.com/t/copy-textfield-value/19953/1 "2019-04-15T22:21:34Z")

</div>

Well this should be really easy but I have searched the Wiki and the Forums and come up blank.

On a form you have a textField that uses a column as its dataProvider. You want to copy that textField’s value to another textField that does not have a dataProvider.

How is that done?

thanks,

Terry

---

<div class="post-metadata">

**Author:** ![Joas](https://yyz2.discourse-cdn.com/flex010/user_avatar/forum.servoy.com/joas/32/5095_2.png) [@Joas](https://forum.servoy.com/u/Joas)\
**Post date:** [April 16, 2019, 7:52am UTC](https://forum.servoy.com/t/copy-textfield-value/19953/2 "2019-04-16T07:52:45Z")

</div>

Both text fields should have a dataprovider.

What are you trying to do? The dataprovider of your second textfield should probably be a form- or scope variable.

---

<div class="post-metadata">

**Author:** ![tkilshaw1553613063](https://avatars.discourse-cdn.com/v4/letter/t/f08c70/32.png) [@tkilshaw1553613063](https://forum.servoy.com/u/tkilshaw1553613063)\
**Post date:** [April 16, 2019, 3:25pm UTC](https://forum.servoy.com/t/copy-textfield-value/19953/3 "2019-04-16T15:25:31Z")

</div>

Joas,

thanks for your help.

I am just learning a bit about Servoy. Let me put my question another way.

Suppose that I have a textField that has a column dataProvider and that textField has a numerical value for a record of 25.5.

How can I programatically access the textField’s value, multiply it with another number and then display it in another textField?

Terry

---

<div class="post-metadata">

**Author:** ![Joas](https://yyz2.discourse-cdn.com/flex010/user_avatar/forum.servoy.com/joas/32/5095_2.png) [@Joas](https://forum.servoy.com/u/Joas)\
**Post date:** [April 16, 2019, 3:53pm UTC](https://forum.servoy.com/t/copy-textfield-value/19953/4 "2019-04-16T15:53:43Z")

</div>

Let’s say you have 3 columns: price, amount and total  
To calculate the total you want to multiply the price with the amount.  
For this you need just one line of code:

````auto
total = amount * price;
```Easy, right?

Basically, you don't care about showing the value in the textfield, Servoy handles that for you (automatic data binding)

Here shown in developer where the amount and price fields use the same method on their onDataChange event. So whenever one of them changes, the total is calculated automatically:
[attachment=0]script.png[/attachment]
````

---

<div class="post-metadata">

**Author:** ![tkilshaw1553613063](https://avatars.discourse-cdn.com/v4/letter/t/f08c70/32.png) [@tkilshaw1553613063](https://forum.servoy.com/u/tkilshaw1553613063)\
**Post date:** [April 16, 2019, 10:09pm UTC](https://forum.servoy.com/t/copy-textfield-value/19953/5 "2019-04-16T22:09:44Z")

</div>

Joas,

that makes sense - for the first time!

many thanks,

Terry
