# Multi line textarea definition ionic2 in alert

**URL:** <https://forum.ionicframework.com/t/multi-line-textarea-definition-ionic2-in-alert/46298>\
**Category:** uncategorized\
**Created:** [March 13, 2016, 6:01pm UTC](https://forum.ionicframework.com/t/multi-line-textarea-definition-ionic2-in-alert/46298 "2016-03-13T18:01:13Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![tollenaere](https://avatars.discourse-cdn.com/v4/letter/t/f9ae1b/32.png) [@tollenaere](https://forum.ionicframework.com/u/tollenaere)\
**Post date:** [March 13, 2016, 6:01pm UTC](https://forum.ionicframework.com/t/multi-line-textarea-definition-ionic2-in-alert/46298/1 "2016-03-13T18:01:13Z")

</div>

Is there any example how to define and/or use multiline textarea in ionic2? What are the attributes? I would like to add it to an alert and define the size.

Thanks

---

<div class="post-metadata">

**Author:** ![twinspike](https://avatars.discourse-cdn.com/v4/letter/t/6a8cbe/32.png) [@twinspike](https://forum.ionicframework.com/u/twinspike)\
**Post date:** [May 22, 2016, 5:56pm UTC](https://forum.ionicframework.com/t/multi-line-textarea-definition-ionic2-in-alert/46298/2 "2016-05-22T17:56:01Z")

</div>

I would also like to know if we are able to have a textarea in an alert. I’m using alert to gather some small user input in places, so far I have a few input alerts for one word, and 1 or 2 radio button alerts, I feel that if I use a modal for the one textarea input, it will take away from the feel of my app.

---

<div class="post-metadata">

**Author:** ![lawlesscreation](https://sea1.discourse-cdn.com/ionicframework/user_avatar/forum.ionicframework.com/lawlesscreation/32/112836_2.png) [@lawlesscreation](https://forum.ionicframework.com/u/lawlesscreation)\
**Post date:** [July 31, 2016, 6:30pm UTC](https://forum.ionicframework.com/t/multi-line-textarea-definition-ionic2-in-alert/46298/3 "2016-07-31T18:30:50Z")

</div>

I’m in the same boat. At present it doesn’t look like anything other than `<input>` is supported. It would be good if an Alert also supported `<textarea>`.

---

<div class="post-metadata">

**Author:** ![vazad](https://avatars.discourse-cdn.com/v4/letter/v/ecccb3/32.png) [@vazad](https://forum.ionicframework.com/u/vazad)\
**Post date:** [September 16, 2016, 10:57pm UTC](https://forum.ionicframework.com/t/multi-line-textarea-definition-ionic2-in-alert/46298/4 "2016-09-16T22:57:24Z")

</div>

Not a very neat solution but I am using this injected into the template code towards the bottom of the file.  
`<template ngSwitchCase=\"textarea\">\n <div class=\"alert-input-group\">\n <div *ngFor=\"let i of d.inputs\" class=\"alert-input-wrapper\">\n <textarea [placeholder]=\"i.placeholder\" [(ngModel)]=\"i.value\" [type]=\"i.type\" class=\"alert-input\"></textarea>\n </div>\n </div>\n </template>\n\n`  
in the node\_modules/ionic-angular/components/alerts/alert.js

Remember this will need to be re done if you update.

---

<div class="post-metadata">

**Author:** ![dqj](https://avatars.discourse-cdn.com/v4/letter/d/b38774/32.png) [@dqj](https://forum.ionicframework.com/u/dqj)\
**Post date:** [January 19, 2017, 3:06am UTC](https://forum.ionicframework.com/t/multi-line-textarea-definition-ionic2-in-alert/46298/5 "2017-01-19T03:06:37Z")

</div>

I had to tweak what @vazad added:

`'<template ngSwitchCase="textarea"><div class="alert-input-group"><div *ngFor="let i of d.inputs" class="alert-input-wrapper"><textarea [(ngModel)]="i.value" class="alert-input"></textarea></div></div></template>' +`

Unfortunately, the enter key is still tied to the submission button. Seems like this would be fairly straightforward addition to the core, though.
