# Update value of a textarea

**URL:** <https://discuss.emberjs.com/t/update-value-of-a-textarea/12875>\
**Category:** Questions\
**Created:** [May 1, 2017, 11:13pm UTC](https://discuss.emberjs.com/t/update-value-of-a-textarea/12875 "2017-05-01T23:13:56Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![skitterm](https://avatars.discourse-cdn.com/v4/letter/s/6a8cbe/32.png) [@skitterm](https://discuss.emberjs.com/u/skitterm)\
**Post date:** [May 1, 2017, 11:13pm UTC](https://discuss.emberjs.com/t/update-value-of-a-textarea/12875/1 "2017-05-01T23:13:56Z")

</div>

In order to have 1-way data flow, I’m using a `<textarea>` element directly instead of the `{{textarea}}` helper. After I type text into the textarea, though, I’m not able to declaratively update the text!

I can start with a default value, like this: `<textarea>{{name}}</textarea>`

As long as I don’t type into the textarea, I can change the “name” property and it will update the textarea text automatically. Once I type into the textarea, though, the textarea doesn’t get updated when I change the “name” property.

I suspect this is because of the JavaScript “value” property on the textarea, but this same exercise works with an input tag. Any ideas of how to keep 1-way data flow but get this to work? I could probably change the JavaScript `value` property of the textarea when the property changes, but that feels like I’m forcing it when it should just update.

Ember twiddle: [Ember Twiddle](https://ember-twiddle.com/0bc580c454ea7f9d25d2aeae626845a1)

---

<div class="post-metadata">

**Author:** ![skitterm](https://avatars.discourse-cdn.com/v4/letter/s/6a8cbe/32.png) [@skitterm](https://discuss.emberjs.com/u/skitterm)\
**Post date:** [May 1, 2017, 11:22pm UTC](https://discuss.emberjs.com/t/update-value-of-a-textarea/12875/2 "2017-05-01T23:22:28Z")

</div>

Well how about that – doing `<textarea value={{name}}></textarea>` instead of `<textarea>{{name}}</textarea>` seems to have solved this! Though that’s unexpected since the same thing doesn’t work in plain html (setting value attribute doesn’t set textarea’s text).

---

<div class="post-metadata">

**Author:** ![Vishu](https://avatars.discourse-cdn.com/v4/letter/v/e99b99/32.png) [@Vishu](https://discuss.emberjs.com/u/Vishu)\
**Post date:** [May 5, 2017, 10:00am UTC](https://discuss.emberjs.com/t/update-value-of-a-textarea/12875/3 "2017-05-05T10:00:58Z")

</div>

Hi skittem,

You can use default handlebar textare as follow :

```
{{textarea type='text' value= name rows=6 class='form-control'}}

```

But, If you want to use

`

{{name}}

`

Write it as

`

{{food}}

` It will bind correctly.

---

<div class="post-metadata">

**Author:** ![kimek](https://sea1.discourse-cdn.com/flex019/user_avatar/discuss.emberjs.com/kimek/32/13608_2.png) [@kimek](https://discuss.emberjs.com/u/kimek)\
**Post date:** [April 20, 2018, 3:53pm UTC](https://discuss.emberjs.com/t/update-value-of-a-textarea/12875/4 "2018-04-20T15:53:48Z")

</div>

Same bits here: Why on second click I cannot change textarea ? ☹

---

<div class="post-metadata">

**Author:** ![Jogi\_Jacob](https://sea1.discourse-cdn.com/flex019/user_avatar/discuss.emberjs.com/jogi_jacob/32/13963_2.png) [@Jogi\_Jacob](https://discuss.emberjs.com/u/Jogi_Jacob)\
**Post date:** [May 16, 2018, 3:00am UTC](https://discuss.emberjs.com/t/update-value-of-a-textarea/12875/5 "2018-05-16T03:00:26Z")

</div>

it should change, what is the exact scenario you looking into?
