Crystal
Posts: 0
Joined: Mon Nov 25, 2013 8:49 am

How to change the size of TextArea?

Hello,
I want to set the size of the TextArea to adapt to the content in the TextArea.
The code is like this :
$('textarea[dsid="mobiletextarea_44"]').css('height', 'auto');
mobiletextarea_44 is the name of TextArea.

But it does not work.So how to do?

Maryna Brodina
Posts: 0
Joined: Thu Apr 05, 2012 7:27 am

How to change the size of TextArea?

Hello!
Try to set Textarea height property equal to it's scrollHeight.

Crystal
Posts: 0
Joined: Mon Nov 25, 2013 8:49 am

How to change the size of TextArea?

But I don't know the scroll height of the textArea.The content in the textArea is different. So I want set the height to adapt to the content.

Igor
Posts: 0
Joined: Tue Apr 02, 2013 12:05 pm

How to change the size of TextArea?

Hello,

You can use Jquery elastic plugin. Add jQuery.elastic.js file to the project and add next code to the page load event:

pre

Appery("mobiletextarea_20").elastic();

/pre

http://unwrongest.com/projects/elastic/

Oscar
Posts: 0
Joined: Tue Jun 03, 2014 8:22 pm

How to change the size of TextArea?

Hi,

I tried this solution but doesn't works for me.

Well, I tried so many theorycall solutions but nothing works in application, but works in Test option.

· I put overflow:auto and I've got scroll in Test but I haven't got in App.
· I applied new height using ScrollHeight and ScrollTop but doesn't works.
· I used elastic but doesn't works in Desktop Test and in App, but works in Mobile Test
I used flexibleArea (another plugin like elastic) and doesn't works in Desktop Test and in App, but works in Mobile Test.

So, can anyone give me a tested solution, please?

Thanks in advance.

Yurii Orishchuk
Posts: 0
Joined: Fri Feb 14, 2014 8:20 am

How to change the size of TextArea?

Hi Oscar.

Given solution is tested and worked.

So please try this again. More details:

1 Create new Javascript and fill it with code from http://unwrongest.com/projects/elastic/

http://prntscr.com/3wizoy/direct

2 Put textarea onto the page you need. http://prntscr.com/3wj07g/direct

3 Add "page show" event handler and fill it with following code: http://prntscr.com/3wj0v3/direct

pre

//Note: you should replace "mobiletextarea_32" with your textarea name.
Apperyio("mobiletextarea_32").elastic();

/pre

Regards.

Return to “Issues”